CONNECTION_LOST not triggered for Unity iOS

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

anniyan137
Posts: 25
Joined: 20 Nov 2012, 10:49

CONNECTION_LOST not triggered for Unity iOS

Postby anniyan137 » 18 Mar 2013, 06:52

Hi Thomas,

We have been encountering this issue ever since the v1.0.6 Unity C# API. Everything seems to work fine except for the CONNECTION_LOST event not triggering on the client side. This happens not only on the phone but also on the Unity editor for iOS. We have updated to the newest version of the API. But we're still facing the same problem.

PS: This doesn't happen on Android or web player or PC versions of the same game.

I would appreciate any kind of guidance in this issue as we're completely baffled and also stuck on the iOS build because of this.

Thanks in advance! :)

Edit: The server logs also don't seem to reflect this disconnection event. Any suggestions?
Last edited by anniyan137 on 18 Mar 2013, 09:09, edited 1 time in total.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: CONNECTION_LOST not triggered for Unity iOS

Postby Lapo » 18 Mar 2013, 08:44

Are you sure you are testing with the latest 1.1.0?
http://www.smartfoxserver.com/download/sfs2x#p=updates

If so can you please under which circumstances the event does not trigger? Manual disconnect? Kick from server? Unexpected disconnection?

thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
anniyan137
Posts: 25
Joined: 20 Nov 2012, 10:49

Re: CONNECTION_LOST not triggered for Unity iOS

Postby anniyan137 » 18 Mar 2013, 09:18

Hi Lapo,

I am 100% sure that I'm using the new API v1.1.0. I am disconnecting the ethernet cable from the computer. And I also wait for at least a minute for the event to fire. The reconnection timeout that I've given on the server is 30 seconds. This works fine on Android and web player(on PC). The web player on the iMac also appears to have the same problem.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: CONNECTION_LOST not triggered for Unity iOS

Postby Lapo » 18 Mar 2013, 09:52

Now I am a little confused.
If reconnection time is 30 seconds, and the disconnection fires after 1 minute there's no way you can reconnect. This is expected.

As regards the Null pointer exception, please make sure to:
1 -> download the API again
2 -> Remove the previous DLL from the Project inspector in Unity
3 -> Drag and drop the new DLL in the Project inspector

thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
anniyan137
Posts: 25
Joined: 20 Nov 2012, 10:49

Re: CONNECTION_LOST not triggered for Unity iOS

Postby anniyan137 » 18 Mar 2013, 10:01

Lapo wrote:Now I am a little confused.
If reconnection time is 30 seconds, and the disconnection fires after 1 minute there's no way you can reconnect. This is expected.


The event never fires. I mentioned that I waited until one minute just to be sure. Please excuse my inability to use jargon properly. I'm new to the whole multiplayer scene.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: CONNECTION_LOST not triggered for Unity iOS

Postby Lapo » 18 Mar 2013, 10:09

You mean that the disconnection event never fires when you pull the ethernet cable?
Lapo

--

gotoAndPlay()

...addicted to flash games
anniyan137
Posts: 25
Joined: 20 Nov 2012, 10:49

Re: CONNECTION_LOST not triggered for Unity iOS

Postby anniyan137 » 18 Mar 2013, 10:12

Yes. It never fires.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: CONNECTION_LOST not triggered for Unity iOS

Postby Lapo » 18 Mar 2013, 10:36

We explain in our documentation that:

    NOTE: Do not attempt to test the reconnection system by pulling the ethernet cable or shutting down the WIFI connection. Both operations will not terminate your current socket connections and therefore the disconnection event will never be triggered.

Please read here:
http://docs2x.smartfoxserver.com/Gettin ... n-hrc-plus
Lapo

--

gotoAndPlay()

...addicted to flash games
anniyan137
Posts: 25
Joined: 20 Nov 2012, 10:49

Re: CONNECTION_LOST not triggered for Unity iOS

Postby anniyan137 » 18 Mar 2013, 13:32

Sorry about that. :(

I skipped HRC+ because I thought I might never have to use it. :(

But thanks a lot for your help! :) How would you recommend I test the connection_lost event then?
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: CONNECTION_LOST not triggered for Unity iOS

Postby Lapo » 18 Mar 2013, 13:47

Use SmartFox.killConnection() on the client or simply shutdown the server while the client is connected.
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X C# API”

Who is online

Users browsing this forum: Thomasea and 34 guests