iOS - crash on disconnect/reconnect

Post here your questions about the HTML5 / JavaScript for SFS2X

Moderators: Lapo, Bax

osc23
Posts: 17
Joined: 04 May 2007, 12:16
Location: London

iOS - crash on disconnect/reconnect

Postby osc23 » 15 Jul 2013, 09:19

Hello guys,

I thought I should share this with you and the forum because it caused me a lot of head scratching...

https://gist.github.com/mloughran/2052006
https://github.com/LearnBoost/socket.io ... /426/files

This isn't a bug with SFS I know. I am going to override the Websocket send in our Main class but do you have any suggestions as to how and where I'd do that in the Smartfox class? Any plans to implement it for the community? ;)

[Edit - I can reproduce in Safari and Chrome so it's just a general iOS issue]

Thanks

Osc23
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: iOS - crash on disconnect/reconnect

Postby Bax » 15 Jul 2013, 13:46

The first post mentions iOS 5 and 5.1. Have you tested this in iOS 6?
Because anyway we offer compatibility with version 6+ of iOS, not previous versions.
Paolo Bax
The SmartFoxServer Team
osc23
Posts: 17
Joined: 04 May 2007, 12:16
Location: London

Re: iOS - crash on disconnect/reconnect

Postby osc23 » 15 Jul 2013, 14:44

Testing on 6.1.2. I've tried to implement the suggestions in those posts and I've seen many more posts about it. I haven't had any joy so far. Most worrying is that it isn't very consistent.

So I have the app on the ipad and in a browser on the desktop. Log in with iPad and then login in the browser to disconnect the pad. Reconnecting sometimes crashes it immediately, some times I get to login and sometimes I connect to the game, view the lobby and can even play. Disconnecting/reconnecting after this always fails by login at best.

Attempting the setTimeout solution in SFS2X.SocketEngine.prototype.send & SFS2X.SocketEngine.prototype._onSocketData. What I don't really understand is how this can be going wrong after connect() which creates a new instance of WebSocket.

I'm particularly concerned about the effect of this if the device sleeps.

Anyway, as I say, not a SFS bug but a pain with iOS that anyone developing an app with websocket is going to face.

I'll let you know if I make any progress

osc23

Return to “SFS2X HTML5 / JavaScript API”

Who is online

Users browsing this forum: No registered users and 24 guests