davidfowl / BedrockFramework

High performance, low level networking APIs for building custom servers and clients.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Disposable issues

adamradocz opened this issue · comments

Noticed a few potential issues:

  • ConnectionLimitMiddleware doesn't call Dispose on SemaphoreSlim _limiter.
  • ConsumableArrayBufferWriter should be sealed or the Dispose should be virtual.
  • TimerAwaitable should be sealed or the Dispose should be virtual.
  • ConnectionContextWithDelegate is disposing the ConnectionContext connection, although it is injected.
  • SocketSender doesn't call Dispose on SocketAsyncEventArgs _eventArgs. Plus, the _eventArgs.Completed += (_, e) => ((SocketAwaitable)e.UserToken).Complete(e.BytesTransferred, e.SocketError); not a memory leak, as it never unsubscribed? This is the same with the SocketReceiver.
  • ServerConnection doesn't call Dispose on CancellationTokenSource _connectionClosingCts.
  • Server doesn't call Dispose on TimerAwaitable _timerAwaitable.