I am writing an app where the server will periodically go offline and come back online, and I need the client to automatically reconnect, and when it does I need it to send some specific messages to re-initialize things.
I think the client is reconnecting automatically as the exceptions stop getting logged once I start the server again, however I can't find a way to get notified when the client reconnects (on the client side that is) and because of this there I have no way to trigger the sending of the specific messages I need to send when the client reconnects.
How can I solve this problem? There must be a way and I am just not seeing it.... like there must be an onConnected event?
Hi there,
I am writing an app where the server will periodically go offline and come back online, and I need the client to automatically reconnect, and when it does I need it to send some specific messages to re-initialize things.
I think the client is reconnecting automatically as the exceptions stop getting logged once I start the server again, however I can't find a way to get notified when the client reconnects (on the client side that is) and because of this there I have no way to trigger the sending of the specific messages I need to send when the client reconnects.
How can I solve this problem? There must be a way and I am just not seeing it.... like there must be an onConnected event?
Thanks for your time and contributions.