Socket connection close when Iphone gone into idle mode

Oct 10, 2012 at 3:26 AM

Hi kerryjiang,

I made an game app on iphone,

I use xcode and phonegap to deploy my app,

Everything is ok, but when iphone gone into idle mode, or I press home button, or press power. After that, I back to game, the socket connection was close,

Is this the websocket problem or phonegap problem or iphone problem,


Oct 10, 2012 at 3:46 AM

Obviously, it's the problem of iphone or phonegap.

But, it's not real problem, if you find the connection is closed, just reconnect it.

Oct 10, 2012 at 3:53 AM

But my old game server can not do that, because of game server structure,

Thanks kerryjiang,

Oct 10, 2012 at 3:54 AM

Oh, it's not business of the server side. It;s the client side issue.

Oct 10, 2012 at 4:43 AM

In waitting room, reconnect solve my problem,

but in game play, client can not reconnect, game server detect this user is anonymous and this user can not continue playing, my game server is card game,


Oct 10, 2012 at 4:44 AM

may be I will find the answer in some phonegap or xocde link,

Thanks erryjiang

Oct 10, 2012 at 4:46 AM

I my idea, reconnect means connect with the server and then log in (obtain credential) again.

Or you can keep login credential in cookie.

Oct 10, 2012 at 5:00 AM

Because in my card game, some user hack the system by close the browser ( or playing game tab ) when he thinks he will become looser and the looser will lost game coin.

So when connection this connect, server force this user is looser and subtract game coin

But when They press power ( not intentionally ) , the they become looser ( I must solve this )

Some game on ios can do it ( but they don't use phonegap ),

I thinks, i will search some solution on internet,

This is not websocket server problem,

Thanks erryjiang