Reputation: 831
I'm working on a native iOS app that is using IBM Worklight
server adapters.
Is there any function or any further way that let me able to know if I'm currently connected to the server (so my session is open and I can invoke my procedure immediately) or not then I need to establish new connection via WLClient().wlConnectWithDelegate(self)
?
Upvotes: 0
Views: 160
Reputation: 44516
There is no such API provided by the Worklight framework.
The idea behind the connect API is to establish a session between the client and server, negating a possible occurrence of a race condition (for example two adapter requests to the server, each getting its own session, potentially causing trouble). This, in addition to delivering data on headers that is not available in an adapter request compared to connect request.
I think that instead of making a connect request before invocation you can do it in an early stage in the app's lifecycle, as well as whenever the app returns to the foreground, to ensure that a session was established. This, coupled together with an appropriate session timeout set in worklight.properties on the server-side.
Upvotes: 1