예제 #1
0
 private static WebSocketServerProtocolConfig CheckNotNull(WebSocketServerProtocolConfig serverConfig)
 {
     if (serverConfig is null)
     {
         ThrowHelper.ThrowArgumentNullException(ExceptionArgument.serverConfig);
     }
     return(serverConfig);
 }
예제 #2
0
        internal WebSocketServerProtocolHandshakeHandler(WebSocketServerProtocolConfig serverConfig)
        {
            if (serverConfig is null)
            {
                ThrowHelper.ThrowArgumentNullException(ExceptionArgument.serverConfig);
            }

            _serverConfig = serverConfig;
        }
예제 #3
0
 public WebSocketServerProtocolHandler(string websocketPath, string subprotocols, bool checkStartsWith,
                                       bool dropPongFrames, long handshakeTimeoutMillis,
                                       WebSocketDecoderConfig decoderConfig)
     : this(WebSocketServerProtocolConfig.NewBuilder()
            .WebsocketPath(websocketPath)
            .Subprotocols(subprotocols)
            .CheckStartsWith(checkStartsWith)
            .HandshakeTimeoutMillis(handshakeTimeoutMillis)
            .DropPongFrames(dropPongFrames)
            .DecoderConfig(decoderConfig)
            .Build())
 {
 }
            internal Builder(WebSocketServerProtocolConfig serverConfig)
            {
                if (serverConfig is null)
                {
                    ThrowHelper.ThrowArgumentNullException(ExceptionArgument.serverConfig);
                }

                _websocketPath           = serverConfig.WebsocketPath;
                _subprotocols            = serverConfig.Subprotocols;
                _checkStartsWith         = serverConfig.CheckStartsWith;
                _handshakeTimeoutMillis  = serverConfig.HandshakeTimeoutMillis;
                _forceCloseTimeoutMillis = serverConfig.ForceCloseTimeoutMillis;
                _handleCloseFrames       = serverConfig.HandleCloseFrames;
                _sendCloseFrame          = serverConfig.SendCloseFrame;
                _dropPongFrames          = serverConfig.DropPongFrames;
                _decoderConfig           = serverConfig.DecoderConfig;
            }
예제 #5
0
 public WebSocketServerProtocolHandler(WebSocketServerProtocolConfig serverConfig)
     : base(CheckNotNull(serverConfig).DropPongFrames, serverConfig.SendCloseFrame, serverConfig.ForceCloseTimeoutMillis)
 {
     _serverConfig = serverConfig;
 }