on 2012 Mar 28 12:16 PM
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.
Request clarification before answering.
Yes, use the timeout network protocol option.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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);
Set it using the setLivenessTimeout method on your SyncParms object.
You might also want to add a progress indication "dialog" with an option to cancel. It would need to implement SyncObserver
and have the syncProgress
method return false
to continue or true
to cancel.
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.
User | Count |
---|---|
52 | |
10 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.