internal WebSocketContext RegisterNewWebSocket(Socket clientSocket, string sec_websocket_key)
        {
            WebSocketContext wbSocketConn = new WebSocketContext(this, webSocketReqHandler);
            workingWebSocketConns.Add(wbSocketConn.ConnectionId, wbSocketConn);//add to working socket 
            wbSocketConn.Bind(clientSocket); //move client socket to webSocketConn    
            wbSocketConn.SendExternalRaw(MakeWebSocketUpgradeResponse(MakeResponseMagicCode(sec_websocket_key)));

            if (newContextConnected != null)
            {
                newContextConnected(wbSocketConn);
            }

            return wbSocketConn;
        }
Beispiel #2
0
 internal WebSocketResponse(WebSocketContext conn, SendIO sendIO)
 {
     this.conn = conn;
     this.sendIO = sendIO;
 }
 internal WebSocketRequest(WebSocketContext context)
 {
     this.context = context;
 }
 internal WebSocketProtocolParser(WebSocketContext context, RecvIO recvIO)
 {
     this.recvIO        = recvIO;
     this._ownerContext = context;
     myBufferStream     = new RecvIOBufferStream(recvIO);
 }