vpurohit
We are using LS client for OSX.
- If network/wifi goes off in middle of a session we get connection closed event
- Once network is available again, we try to do the connection again
-- We 1st call unsubscribeItems on previous connection
-- Then call closeConnection
-- Re-initialize new connection
Here on calling "unsubscribeItems" application just hangs. This is turning out to be a critical issue for us to handle. Any quick help would be appreciated.
Thanks,
Vedang Purohit
Intralinks Inc.
gianluca.bertani
Hello,
the OS X client, just like iOS client, monitors the network status and is able to automatically reconnect in case of connection loss. You may try it with the sample application: open it and switch off then on the wi-fi adapter, the app will reconnect automatically. You may see from the app's sources that there is no code handling the reconnection in the clientConnection:didReceiveConnectionFailure:and clientConnection:didReceiveServerFailure: events, it is automatic. Our advice is to use the automatic reconnection whenever is possible.
Also, be sure to update your OS X client library to the latest version, 1.0.2 build 4.8, included in the latest Lightstreamer Server distribution. It contains many important bug fixes and documentation fixes. The updated documentation home page contains an improved explanation of the automatic reconnection mechanism, see there for more information.
Hope this helps.
Best regards,
Gianluca
vpurohit
Here is sample code we are using for connection -
[LSConnectionInfo connectionInfoWithPushServerURL :Smile_Ah: ILDefaults pushServerURL]
pushServerControlURL:nil
user :Smile_Ah: ILDefaults globalSessionId]
password:nil
adapter:@"IL"];
As you can see above that we are using our session (which can change/expire after 60 minutes) for user name. This was required because we had to bridge push server connection with our core server. Now whenever session expires we'll have to reconnect with LS/Push server again with a new session. In this case do we still need to call "unsubscribe items" and then open connection again or simply open connection.
We also tried updating to the newest library but we are still not getting notifications on re-connection.
Right now this is quite an escalated issue since it is holding a release. Can we get on a phone call to discuss it further.
Thanks,
Vedang Purohit
Intralinks Inc.
gianluca.bertani
Hello again,
when your session expires, it is enough to call a closeConnection and then open the new connection appropriately. There's no need to unsubscribe all tables first, they will be cleared together with the connection. Recall that such calls should not be done on the thread of an LSConnectionDelegate event, but rather on on a separate background thread.
We still recommend to rely on the OS X client automatic resubscription for situations where the connection drops for external reasons. If you can't distinguish the two situations (session expiration vs. connection drop) then forcibly close the connection in both cases, by spawing a closeConnection call during the appropriate LSConnectionDelegate event, as explained on the home page of the OS X documentation.
Anyway, we are available for a phone or Skype call to discuss the issue further. Please contact support so it can be scheduled with the people involved.
Best regards,
Gianluca