internal HttpListenerWebSocketContext(
     HttpListenerContext context, Logger logger)
 {
     _context   = context;
     _stream    = WsStream.CreateServerStream(context);
     _websocket = new WebSocket(this, logger ?? new Logger());
 }
Esempio n. 2
0
 internal TcpListenerWebSocketContext(TcpClient client, bool secure, X509Certificate cert)
 {
     _client    = client;
     _secure    = secure;
     _stream    = WsStream.CreateServerStream(client, secure, cert);
     _request   = HandshakeRequest.Parse(_stream.ReadHandshake());
     _websocket = new WebSocket(this);
 }
Esempio n. 3
0
 internal TcpListenerWebSocketContext(TcpClient client, bool secure)
 {
     _client   = client;
     _isSecure = secure;
     _stream   = WsStream.CreateServerStream(client, secure);
     _request  = RequestHandshake.Parse(_stream.ReadHandshake());
     _socket   = new WebSocket(this);
 }
 internal TcpListenerWebSocketContext(TcpClient client, X509Certificate cert, bool secure, Logger logger)
 {
     this._client    = client;
     this._secure    = secure;
     this._stream    = WsStream.CreateServerStream(client, cert, secure);
     this._request   = this._stream.ReadHandshake <HandshakeRequest>(new Func <string[], HandshakeRequest>(HandshakeRequest.Parse), 90000);
     this._websocket = new WebSocket(this, logger);
 }
 internal HttpListenerWebSocketContext(HttpListenerContext context)
 {
     _context = context;
     _stream  = WsStream.CreateServerStream(context);
     _socket  = new WebSocket(this);
 }