07-18-2012 02:15 PM
In java EE,
socket.isconnected() can be used to check connection status.
I could not find a related class in the BlackBerry API.
if anyone knows it, please tell me.
Thanks your attention,
07-18-2012 05:27 PM
02-17-2014 07:02 AM
If you have a new question, please start a new Thread.
A heartbeat message is not related to socket connections, it is a generic name for an application to application message, specific to those applications.
02-18-2014 05:25 PM
Hello, I had a similar problem. Eventually my solution (although not elegant) was to create a "heartbeat" thread. The thread loops repeatedly and send an alive check message to the server. When the server receives the message it sends a reply back. If the thread doesn't receive the reply in a certain amount of time (in my case 5 seconds) it can assume that the connection is dead.
Hope it helps
Do you have any idea what that is going to do to the battery? The best is not to keep a connection opened. Instead, use the BB push notification if the server wants to talk to the client.