How to reconnect when socket gets closed by server?
Hi again, i have just published a version with includes automatic reconnect, i delayed a lot, because a was fixing a problem with py2 compatibility.
Reconnect is now working even after the socket closes!
When websocket re-opens after closing, I see this error:
ERROR error from callback >: Expecting value: line 1 column 1 (char 0)
Websocket stays open after this error and I am still able to receive messages through signalr. So this is probably some kind of warning.
I think that is an error related with auth, if an errors occuurs on the login function library encapsulates it an try login later:
do you refer to that error?
I think that my next exteps on the library must be improving logging and documentation to prevent this kind of things.
Yes after that error, it reconnects and websocket opens again. After websocket opens, then I see this error:
"ERROR error from callback <bound method BaseHubConnection.on_message of signalrcore.hub.base_hub_connection.BaseHubConnection object at 0xb5954410: type"
That error was solved in the 0.74. Was related with the connection handshake. Yesterday I uploaded
the fix. The new version is available since then.
Thank you! I will test it.
How can I send a signalr message everytime websocket reconnects after a disconnect?
I want to send a message to the server when I reconnect.
How can I do this?
On the next version, Callbacks for on_connect and on_disconnect will be included. This change would solve your problem right?
Yes perfect! Thank you so much!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.