socket fixes, fix tank jumping

This commit is contained in:
Vinzenz Schroeter 2024-04-13 16:27:45 +02:00
parent 9620703efc
commit b3dacbd6f6
13 changed files with 44 additions and 46 deletions

View file

@ -18,7 +18,7 @@ internal sealed class ByteChannelWebSocket(WebSocket socket, ILogger logger, int
yield return _buffer.ToArray();
}
if (socket.State != WebSocketState.Closed)
if (socket.State is not WebSocketState.Closed and not WebSocketState.Aborted)
Debugger.Break();
}

View file

@ -93,9 +93,9 @@ internal sealed class ClientScreenServer(
await _channel.SendAsync(pixels.Data);
_lastSentPixels = pixels;
}
catch (ChannelClosedException)
catch (WebSocketException ex)
{
_logger.LogWarning("send failed, channel is closed");
_logger.LogWarning(ex, "send failed");
}
}