From a36873f890576759e1d43cd29f7517da91ae7474 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 18 Oct 2013 16:21:48 -0400 Subject: [PATCH] look at close status before assuming socket is closed. --- .../HttpServer/NativeWebSocket.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Server.Implementations/HttpServer/NativeWebSocket.cs b/MediaBrowser.Server.Implementations/HttpServer/NativeWebSocket.cs index e1f00951ec..ae4d91148b 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/NativeWebSocket.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/NativeWebSocket.cs @@ -120,9 +120,9 @@ namespace MediaBrowser.Server.Implementations.HttpServer var result = await WebSocket.ReceiveAsync(buffer, cancellationToken).ConfigureAwait(false); - if (result.CloseStatus.HasValue) + if (result.CloseStatus.HasValue && result.CloseStatus.Value != WebSocketCloseStatus.Empty) { - _logger.Info("Web socket connection closed by client."); + _logger.Info("Web socket connection closed by client. Reason: {0}", result.CloseStatus.Value); return null; }