Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket connect w/ no session ID #280

Open
lblast opened this issue May 5, 2022 · 3 comments
Open

Socket connect w/ no session ID #280

lblast opened this issue May 5, 2022 · 3 comments

Comments

@lblast
Copy link

lblast commented May 5, 2022

I have experienced problems where the socket connects properly, but there is no session ID. This doesn't happen every time I connect, and typically it happens after the socket has trouble connecting (for example, if WiFi is disabled on the device).

The log when this happens are as follows:
SocketIO_OnReconnectError(): Unable to connect to the remote server.
SocketIO_OnConnected(): Socket connected, but with no session ID.

I'll note that I'm using v3.0.6 and I experience this on Android devices when I turn the wifi off, wait for socket to try reconnecting, and then turn the wifi back on. On iOS I didn't notice this issue.

@doghappy
Copy link
Owner

if you switch your network to another, socket.io will be disconnected, and then it will try to reconnect, it will keep trying to reconnect unless the connect successful, you will get a OnReconnectError after each failure.

you mean you can't get session id after to reconnect successful?

could you show me some logs? because I can't repoduce this issue, I haven't Xarmarin enviroment.

Debug.WriteLine($"[Receive] {text}");

@lblast
Copy link
Author

lblast commented May 18, 2022

That is correct, we see the ReconnectError as expected when the wifi is off, and once we turn it back on we will get OnConnected. If I log the session ID in the OnConnected response it is empty, and checking Connected would return "true".

As mentioned, we only noticed this on Android; although the implementation is no different. What additional logs would help you in this case? I will do my best to provide them.

@doghappy
Copy link
Owner

doghappy commented May 19, 2022

are you developing on Windows?

Fiddler Classic is a good debug tools for http or websocket, it can record data transferred between client and server, you can choose a session, and then Save it in a ArchiveZip, finally send it to me by email(or upload to here).

if you have any secret in those data, you also can edit ArchiveZip.

if I get an ArchiveZip, I can restore this data in fiddler and then I can analyze the issue.


if you can't use Fiddler, you should clone this repo, add it to your project, then you can record log in here:

Debug.WriteLine($"[Receive] {text}");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants