iPhoneClient connection management.

Post here your questions about the Objective-C API for SFS2X

Moderators: Lapo, Bax

mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

iPhoneClient connection management.

Postby mmilen » 23 Feb 2011, 16:15

I run into a headache with iPhoenClient connection management.
I'm running latest RC2b server with zone User Reconnection Time Frame = 0 seconds.

on iPhone 4.
1. start the app connect and login. I can see the user on the server
2. send the app to background
3. Lock screen (using power button)
Right here I can see the client disappearing from the server.
4. Unlock screen call the application back on the screen and surprise the client isConnected is TRUE.
What is going on.
User avatar
cemuzunlar
Posts: 47
Joined: 26 Dec 2008, 00:45
Contact:

Postby cemuzunlar » 26 Feb 2011, 14:38

The sleep and wake-up events can only be handled in your app delegate. There is no way for us to handle that event.

So, it is your responsibility to watch for that events and take appropriate action, in that case destroy/recreate the SFS object.

Please check this:
"One of the main jobs of the application delegate is to track the state transitions the application goes through while it is running. Prior to iOS 4.0, applications were either active, inactive, or not running. In iOS 4.0 and later, applications can also be running in the background or suspended. All of these transitions require a response from your application to ensure that it is doing the right thing. For example, a background application would need to stop updating its user interface. You provide the response to these transitions using the methods of the application delegate."
[url=http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/UIApplicationDelegate]UIApplicationDelegate Protocol Reference[/url]

We'll test the system again anyway to see if there is anything we can do.
Cem Uzunlar
Infosfer Game and Visualization Technologies
http://www.infosfer.com
contact@infosfer.com
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Postby mmilen » 26 Feb 2011, 20:02

I do agree with all you have said, but never the less I have to get some indication from the SFSClient of it's state.

If you just send the app to the background and do not lock the screen the connection never gets dropped and once the app is called to foreground it continues working as a charm. However if the screen is locked when the app is minimized the client disconnects but it never shows it in it's isConnected state. It is very hard for my application code to know the state of it's connection if the SFSClient does not know that either.
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Postby mmilen » 26 Feb 2011, 20:04

That is the big problem no SFS events are fired what so ever. Please check the client with the procedure I have described.
User avatar
cemuzunlar
Posts: 47
Joined: 26 Dec 2008, 00:45
Contact:

Postby cemuzunlar » 26 Feb 2011, 21:58

We'll check the client with the procedure you described and try to add some detection for those cases.
Cem Uzunlar

Infosfer Game and Visualization Technologies

http://www.infosfer.com

contact@infosfer.com

Return to “SFS2X iPhone / iPad / OSX API”

Who is online

Users browsing this forum: No registered users and 58 guests