Ejemplo n.º 1
0
        public Task <HttpListenerWebSocketContext> AcceptWebSocketAsync(string subProtocol,
                                                                        int receiveBufferSize,
                                                                        TimeSpan keepAliveInterval)
        {
            HttpWebSocket.ValidateOptions(subProtocol, receiveBufferSize, HttpWebSocket.MinSendBufferSize, keepAliveInterval);

            ArraySegment <byte> internalBuffer = WebSocketBuffer.CreateInternalBufferArraySegment(receiveBufferSize, HttpWebSocket.MinSendBufferSize, true);

            return(this.AcceptWebSocketAsync(subProtocol,
                                             receiveBufferSize,
                                             keepAliveInterval,
                                             internalBuffer));
        }
Ejemplo n.º 2
0
        public static Task <WebSocket> AcceptWebSocketAsync(
            this RequestContext context,
            string subProtocol,
            int receiveBufferSize,
            TimeSpan keepAliveInterval)
        {
            WebSocketHelpers.ValidateOptions(subProtocol, receiveBufferSize, WebSocketBuffer.MinSendBufferSize, keepAliveInterval);

            ArraySegment <byte> internalBuffer = WebSocketBuffer.CreateInternalBufferArraySegment(receiveBufferSize, WebSocketBuffer.MinSendBufferSize, true);

            return(context.AcceptWebSocketAsync(subProtocol,
                                                receiveBufferSize,
                                                keepAliveInterval,
                                                internalBuffer));
        }