Provides the properties used to access the information in a WebSocket connection request received by the TcpListener.
상속: WebSocketContext
예제 #1
0
    // 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 ();
    }
예제 #2
0
 internal WebSocket(TcpListenerWebSocketContext context)
     : this()
 {
     _stream = context.Stream;
       _closeContext = () => context.Close ();
       init (context);
 }
예제 #3
0
        // 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 ();
        }
예제 #4
0
        private void acceptWebSocketAsync(TcpListenerWebSocketContext context)
        {
            WaitCallback callback = (state) =>
              {
            try
            {
              AcceptWebSocket(context);
            }
            catch (Exception ex)
            {
              onError(ex.Message);
            }
              };

              ThreadPool.QueueUserWorkItem(callback);
        }
예제 #5
0
 /// <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);
예제 #6
0
        // 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 ();
        }
예제 #7
0
 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;
 }