Hello, Is there a way to set a connection timeout on my mobile app when trying to synchronize with mobilink server. When my mobilink server is down the application freezes for more than a minute.
This question is marked "community wiki".
|
Yes, use the timeout network protocol option. I cannot find out how to set this parameter, i am using it in android application SyncParms syncParms = _conn.createSyncParms(SyncParms.HTTP_STREAM,"sa", "SyncModel"); syncParms.getStreamParms().setHost(PreferencesUtil.IP); syncParms.getStreamParms().setPort(PreferencesUtil.Port); syncParms.setPublications("MyPublication"); _conn.synchronize(syncParms);
(29 Mar '12, 02:51)
katalun4o
Replies hidden
1
Set it using the setLivenessTimeout method on your SyncParms object.
(29 Mar '12, 10:01)
Bill Somers
1
You might also want to add a progress indication "dialog" with an option to cancel. It would need to implement Also, if your app "freezes" are you not using a worker thread? Even though it doesn't implement an observer or use a separate worker thread for synchronization, you might be interested in Tom Slee's push sample using UltraLiteJ on Android.
(29 Mar '12, 12:42)
Graham Hurst
|