aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/HttpServer/NativeWebSocket.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/NativeWebSocket.cs')
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/NativeWebSocket.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/NativeWebSocket.cs b/MediaBrowser.Server.Implementations/HttpServer/NativeWebSocket.cs
index 96f61912a..e96492317 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/NativeWebSocket.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/NativeWebSocket.cs
@@ -88,6 +88,12 @@ namespace MediaBrowser.Server.Implementations.HttpServer
break;
}
+ if (bytes == null)
+ {
+ // Connection closed
+ break;
+ }
+
if (OnReceiveBytes != null)
{
OnReceiveBytes(bytes);
@@ -110,7 +116,8 @@ namespace MediaBrowser.Server.Implementations.HttpServer
if (result.CloseStatus.HasValue)
{
- throw new WebSocketException("Connection closed");
+ _logger.Info("Web socket connection closed.");
+ return null;
}
return buffer.Array;