fix: WebSockets: Force KeepAliveInterval to Zero

This commit is contained in:
Chris Langsenkamp 2020-06-12 08:24:13 -04:00
parent 285ec968c0
commit 9a42fe3342

View File

@ -131,7 +131,7 @@ async Task ProcessTcpClient(TcpClient tcpClient, CancellationToken token)
WebSocketHttpContext context = await webSocketServerFactory.ReadHttpHeaderFromStreamAsync(tcpClient, stream, token);
if (context.IsWebSocketRequest)
{
// Force KeepAliveInterval to Zero, otherwise the transport is unstable and causes random disconnects
// Force KeepAliveInterval to Zero, otherwise the transport is unstable and causes random disconnects.
WebSocketServerOptions options = new WebSocketServerOptions() { KeepAliveInterval = TimeSpan.Zero, SubProtocol = "binary" };
WebSocket webSocket = await webSocketServerFactory.AcceptWebSocketAsync(context, options);