Owin.WebSocket icon indicating copy to clipboard operation
Owin.WebSocket copied to clipboard

No close after CloseSent

Open raffaeler opened this issue 9 years ago • 0 comments

During a debugging session (where everything is slow) I could verify a situation that lead to the OnDisconnected not being ever sent.

  • The channel was broken because of a long timeout (due to debugging)
  • OnTransportError was called After waiting for a very long time, the OnDisconnected was never called At this point I tried to send a message to the client and I could verify the status of the connection was "CloseSent".

I believe the channel should always call OnDisconnected even if the worst cases when the client cannot be reached anymore.

Also, please consider implementing IDisposable in the WebSockeConnection, exposing the overridable Dispose(bool) (as for dispose pattern) so that disposable resources in derived classes can close the lifecycle of any custom resources.

raffaeler avatar May 20 '16 09:05 raffaeler