// As server internal WebSocket (TcpListenerWebSocketContext context, string protocol) { _context = context; _protocol = protocol; _closeContext = context.Close; _logger = context.Log; _secure = context.IsSecureConnection; _stream = context.Stream; _waitTime = TimeSpan.FromSeconds (1); init (); }
internal WebSocket(TcpListenerWebSocketContext context) : this() { _stream = context.Stream; _closeContext = () => context.Close (); init (context); }
// As server internal WebSocket(TcpListenerWebSocketContext context, Logger logger) { _context = context; _logger = logger; _closeContext = context.Close; _secure = context.IsSecureConnection; _stream = context.Stream; _uri = context.Path.ToUri (); init (); }
private void acceptWebSocketAsync(TcpListenerWebSocketContext context) { WaitCallback callback = (state) => { try { AcceptWebSocket(context); } catch (Exception ex) { onError(ex.Message); } }; ThreadPool.QueueUserWorkItem(callback); }
/// <summary> /// Accepts a WebSocket connection. /// </summary> /// <param name="context"> /// A <see cref="TcpListenerWebSocketContext"/> that contains a WebSocket connection. /// </param> protected abstract void AcceptWebSocket(TcpListenerWebSocketContext context);
// As server internal WebSocket(TcpListenerWebSocketContext context, string protocol, Logger logger) { _context = context; _protocol = protocol; _logger = logger; _closeContext = context.Close; _secure = context.IsSecureConnection; _stream = context.Stream; init (); }
internal WebSocket(TcpListenerWebSocketContext context) : this() { _uri = context.Path.ToUri(); _context = context; _tcpClient = context.Client; _wsStream = context.Stream; _endPoint = context.ServerEndPoint; _isClient = false; _isSecure = context.IsSecureConnection; }