doghappy / socket.io-client-csharp

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

OnDisconnect not fired for 'io server disconnect' event #269

Closed dawalters1 closed 2 years ago

dawalters1 commented 2 years ago

Recently updated to the latest version of this package, and am no longer receiving onDisconnect events for 'io server disconnect'

image - Close event was received image - Nothing in console image - Code is clearly setup to post disconnect

doghappy commented 2 years ago

from which version to upgrade to the latest version?

dawalters1 commented 2 years ago

@doghappy I went from 2.2.1 to 3.0.5 (Connecting to server using 4.4.1)

dawalters1 commented 2 years ago

I went back as far as 2.3.0 and it doesnt appear to detect the servers client.disconnect() event either

dawalters1 commented 2 years ago

Right after making a mock up V4 server myself, I am in-fact able to detect the 'io server disconnect' event, so I am unsure what is actually happening, the service that I am connecting to has a load balancer that disconnects clients every hour, which is when the issue occurs, and the disconnect is not detected.

https://v3-rc.palringo.com:3051/

doghappy commented 2 years ago

Thanks for your service, but I don't know how to connect it, do I need a token or something?

and then: how fired for 'io server disconnect' event

You can send it by mail, thanks :)

dawalters1 commented 2 years ago

I guess that information would of been useful to post now wouldn't of it.

I have sent you a code snippet

doghappy commented 2 years ago

Sorry,I've been busy, free until now.

I've reproduced it last week, but today when I try to fix it, it seems that the token is not avaliable?

dawalters1 commented 2 years ago

Nothing has changed as far as i am aware

Would you mind emailing me your code

doghappy commented 2 years ago

have you tried with the latest code?

Connected To V3 Server
Recieved Packet - welcome
Disconnected From V3 Server -$transport close
Connected To V3 Server
Recieved Packet - welcome

that's my logs

dawalters1 commented 2 years ago

Using the samples project i was also able to get the hourly disconnect as well now 👍🏻