Hi Soot,
I confirm that the strategy you have implemented is considered a best practice, but please also consider that PROBE messages are sent by the server only when no real-time updates are available.
Another possible way is the one implemented by the Java Script SDK, which waits the
Keepalive Interval + the
Stalled Timeout + the
Reconnect Timeout, before disconnecting and trying to reconnect again to the Server (where Stalled Timeout and Reconnect Timeout are generally set to 2 and 3 seconds respectively).
Lastly, you may consider adopting a programmatic approach, through sending a fake message and waiting for the synchronous response. Obviously, you should accept such message in the implementation for the
notifyUserMessageof your MetadataAdapter, in order to avoid throwing any exception. Please have a look at Paragraph 4.4.1 of our
Network Protocol tutorial for more details.
To further investigate the reasons why the server PROBE messages seem so irregular, you should be able to prepare a test on your environment, after having changed the server log configuration as follows:
<logger name="LightstreamerLogger.subscriptions" level="DEBUG">
<logger name="LightstreamerLogger.requests" level="DEBUG"/>
<logger name="LightstreamerLogger.push" level="DEBUG"/>
After that, please upload the log files.
Thanks and Regards,
Gianluca