Best practices for J2ME socket connections

Mar 18, 2012 at 5:55 PM

Has anyone used Supersocket with J2ME clients? I would like to know what you guys implemented to maintain a good connection (despite having no control over the network). Any best practice?

Coordinator
Mar 19, 2012 at 4:40 AM

TCP already provides keeping alive approach, but you also can design your own keeping alive strategy in application level. I think your own keeping alive should be driven by client side.

Mar 19, 2012 at 10:30 AM

Tried both the default keepalive and a custom implementation where a heartbeat is sent by the AppSession every x seconds, but the connection is still not reliable. I guess it has to do with the network. I wonder if moving the heartbeat to the client will have any difference.

Coordinator
Mar 19, 2012 at 10:34 AM

You cannot ensure your network is connected always, but you can reconnect after the connection is dropped.