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)); }
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)); }