public ServerSslHelper(SslConfig sslConfig)
 {
     config = sslConfig;
     if (config.enabled)
     {
         certificate = new X509Certificate2(config.certPath, config.certPassword);
     }
 }
 public WebSocketServer(TcpConfig tcpConfig, int maxMessageSize, int handshakeMaxSize, SslConfig sslConfig, BufferPool bufferPool)
 {
     this.tcpConfig      = tcpConfig;
     this.maxMessageSize = maxMessageSize;
     sslHelper           = new ServerSslHelper(sslConfig);
     this.bufferPool     = bufferPool;
     handShake           = new ServerHandshake(this.bufferPool, handshakeMaxSize);
 }
Exemplo n.º 3
0
        public SimpleWebServer(int maxMessagesPerTick, TcpConfig tcpConfig, int maxMessageSize, int handshakeMaxSize, SslConfig sslConfig)
        {
            this.maxMessagesPerTick = maxMessagesPerTick;
            // use max because bufferpool is used for both messages and handshake
            int max = Math.Max(maxMessageSize, handshakeMaxSize);

            bufferPool = new BufferPool(5, 20, max);

            server = new WebSocketServer(tcpConfig, maxMessageSize, handshakeMaxSize, sslConfig, bufferPool);
        }