コード例 #1
0
        protected WebSocketServerBase(IPAddress address, int port, string absPath, bool secure)
        {
            if (address.IsNull())
            throw new ArgumentNullException("address");

              if (absPath.IsNull())
            throw new ArgumentNullException("absPath");

              string msg;
              if (!absPath.IsValidAbsolutePath(out msg))
            throw new ArgumentException(msg, "absPath");

              if ((port == 80  && secure) ||
              (port == 443 && !secure))
              {
            msg = String.Format(
              "Invalid pair of 'port' and 'secure': {0}, {1}", port, secure);
            throw new ArgumentException(msg);
              }

              _address  = address;
              _port     = port > 0
                ? port
                : secure ? 443 : 80;
              _uri      = absPath.ToUri();
              _isSecure = secure;

              init();
        }
コード例 #2
0
        protected WebSocketServerBase(IPAddress address, int port, string absPath)
        {
            if (address.IsNull())
            throw new ArgumentNullException("address");

              if (absPath.IsNull())
            throw new ArgumentNullException("absPath");

              string msg;
              if (!absPath.IsValidAbsolutePath(out msg))
            throw new ArgumentException(msg, "absPath");

              _address = address;
              _port    = port <= 0 ? 80 : port;
              _uri     = absPath.ToUri();

              init();
        }