mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-05 21:37:10 -04:00
Improve error handling
This commit is contained in:
parent
bdd823d22f
commit
f89e18ea26
@ -149,14 +149,21 @@ namespace Emby.Server.Implementations.HttpServer
|
||||
{
|
||||
await ProcessInternal(pipe.Reader).ConfigureAwait(false);
|
||||
}
|
||||
} while (_socket.State == WebSocketState.Open && receiveresult.MessageType != WebSocketMessageType.Close);
|
||||
} while (
|
||||
(_socket.State == WebSocketState.Open || _socket.State == WebSocketState.Connecting)
|
||||
&& receiveresult.MessageType != WebSocketMessageType.Close);
|
||||
|
||||
Closed?.Invoke(this, EventArgs.Empty);
|
||||
|
||||
await _socket.CloseAsync(
|
||||
WebSocketCloseStatus.NormalClosure,
|
||||
string.Empty,
|
||||
cancellationToken).ConfigureAwait(false);
|
||||
if (_socket.State == WebSocketState.Open
|
||||
|| _socket.State == WebSocketState.CloseReceived
|
||||
|| _socket.State == WebSocketState.CloseSent)
|
||||
{
|
||||
await _socket.CloseAsync(
|
||||
WebSocketCloseStatus.NormalClosure,
|
||||
string.Empty,
|
||||
cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ProcessInternal(PipeReader reader)
|
||||
|
Loading…
Reference in New Issue
Block a user