Silent Reconnection fails silently

Post here your questions about the Flash / Flex / Air API for SFS2X

Moderators: Lapo, Bax

User avatar
rewb0rn
Posts: 177
Joined: 26 Jan 2009, 12:54
Location: Berlin, Germany

Silent Reconnection fails silently

Postby rewb0rn » 24 Feb 2015, 09:41

Hi all,

I am currently testing the HRC silent reconnection and I noticed that if the reconnection fails, in like 10% of cases I will not receive a CONNECTION_LOST event. I am testing on Android with Adobe Air and Smartfox client library 1.2.5 against Smartfoxserver 2.9.2 as follows:

- Silent reconnection param set to 10 seconds
- Start app on Android and connect to Smartfox with Wifi connection on
- Minimize app and close Wifi
- Resume app
- SFSEvent.CONNECTION_RETRY is fired
- waiting
- In some cases, neither SFSEvent.CONNECTION_RESUME or SFSEvent.CONNECTION_LOST is fired

Am I missing something or is this a potential bug in the library? This is currently a medium issue in our app because the app will show a "reconnecting.." popup and then the app will stop responding.

Thanks,
Ruben
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Silent Reconnection fails silently

Postby Lapo » 24 Feb 2015, 17:38

Switching the Wifi is crapshoot, similar to unplugging the ethernet cord... we don't recommend it, but of course is another scenario that developers might want to handle.
Here we describe how to test HRC+:
http://docs2x.smartfoxserver.com/Gettin ... n-hrc-plus

Anyways to reply to your post:
Is the Wifi resumed within 10 seconds? It's not explained in the flow.

If you're switching between Wifi and 3G it's expected that it may not work. TCP was designed 40 years ago without mobility in mind and we're stuck with this technology. The SFS2X API simply react to the underlying TCP events. If no signal bubbles up, we cannot react :(

If you test this scenario on a PC you will get a totally different effect because you're running a different OS with a different TCP stack.

There's not much more we can do about it. The HRC+ can help re-establishing a lost connection under different circumstances but it's not a silver bullet, nor it can overcome the shortcomings of the transport protocol.

Switching between networks (such as Wifi --> 3G/4G and viceversa) could be handled separately by listening to the OS specific events (does AIR provide notifications?) and re-creating a new connection.

hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
rewb0rn
Posts: 177
Joined: 26 Jan 2009, 12:54
Location: Berlin, Germany

Re: Silent Reconnection fails silently

Postby rewb0rn » 25 Feb 2015, 10:05

Hi Lapo,

thanks for the clarification. I have seen the similar behavior (reconnecting popup never closing after reconnection attempt) in different scenarios, but switching off the Wifi was a good way to reproduce it. I will discontinue the use of HRC then, as our regular reconnection flow is very stable.

Thanks!

Return to “SFS2X ActionScript 3 API”

Who is online

Users browsing this forum: No registered users and 11 guests