remove a bunch of locks

This commit is contained in:
Vinzenz Schroeter 2024-05-03 14:45:41 +02:00 committed by RobbersDaughter
parent b3bf62b391
commit d7b8664062
13 changed files with 126 additions and 143 deletions

View file

@ -3,9 +3,8 @@ namespace TanksServer.Interactivity;
internal abstract class WebsocketServerConnection(
ILogger logger,
ByteChannelWebSocket socket
) : IDisposable
)
{
private readonly SemaphoreSlim _mutex = new(1);
protected readonly ByteChannelWebSocket Socket = socket;
protected readonly ILogger Logger = logger;
@ -25,6 +24,4 @@ internal abstract class WebsocketServerConnection(
public abstract ValueTask RemovedAsync();
protected abstract ValueTask HandleMessageAsync(Memory<byte> buffer);
public virtual void Dispose() => _mutex.Dispose();
}