doghappy / socket.io-client-csharp

socket.io-client implemention for .NET
MIT License
729 stars 125 forks source link

SocketIO.DisconnectAsync() returns too early #237

Open roavin opened 2 years ago

roavin commented 2 years ago

As the title states - the Task returned by SocketIO.DisconnectAsync is completed before the disconnect process is completed, which leads to unexpected callbacks to be called afterward.

Presumably, the fix involves making InvokeDisconnect return Task and awaiting the call to it in DisconnectAsync().