コード例 #1
0
        public TcpPinger(
            string machineName,
            int port,
            int timeoutMillis = 0)
        {
            if (timeoutMillis < 0)
            {
                throw new ArgumentOutOfRangeException(
                          "timeoutMillis", "Timeout is less than zero.");
            }

            this._timeout = timeoutMillis == 0
                                ? DefaultTimeout
                                : timeoutMillis;

            this._machineName = machineName;
            this._port        = port;
            this._pingHandler = PingPort;
        }
コード例 #2
0
        public TcpPinger(
			string machineName,
			int    port,
			int    timeoutMillis = 0)
        {
            if (timeoutMillis < 0)
            {
                throw new ArgumentOutOfRangeException(
                    "timeoutMillis", "Timeout is less than zero.");
            }

            this._timeout = timeoutMillis == 0
                ? DefaultTimeout
                : timeoutMillis;

            this._machineName = machineName;
            this._port        = port;
            this._pingHandler = PingPort;
        }