Highly Resilient Connection (HRC) system problem

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

Moderators: Lapo, Bax

sankarganesh86
Posts: 108
Joined: 06 Jan 2010, 09:50
Location: chennai
Contact:

Highly Resilient Connection (HRC) system problem

Postby sankarganesh86 » 30 Nov 2017, 11:26

Hi,

Server version 2.13
Client API 1.7.5
And i changed "User Reconnect timeframe" to 50 using Admin tool

And i added below events also in coding part

sfs.addEventListener(SFSEvent.CONNECTION_RESUME, onConnectionResumed);
sfs.addEventListener(SFSEvent.CONNECTION_RETRY, onConnectionRetry);

I create a APK using AS3.0 and launch it in Andorid device , And i disable the Wireless in android device
I received "CONNECTION_RETRY" Event and again i enable the wireless but "CONNECTION_RESUME" Event not received in Client Side AS3
Sankar.G
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Highly Resilient Connection (HRC) system problem

Postby Lapo » 01 Dec 2017, 08:29

Hi,
disabling the Wifi is not the correct way to test a disconnection.

Please read here:
http://smartfoxserver.com/blog/what-rea ... tworkwifi/

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
sankarganesh86
Posts: 108
Joined: 06 Jan 2010, 09:50
Location: chennai
Contact:

Re: Highly Resilient Connection (HRC) system problem

Postby sankarganesh86 » 01 Dec 2017, 09:09

Is there any way to re-establish the connection in this scenario ?
with new instance ?
Sankar.G
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Highly Resilient Connection (HRC) system problem

Postby Lapo » 01 Dec 2017, 09:27

It is possible to detect a network switch (from wifi to 4G or viceversa) via the OS API: both iOS and Android generate events for that.
When you receive the event you can shutdown the current connection, release the relative listeners and start a new one.

Hope it helps
Lapo

--

gotoAndPlay()

...addicted to flash games
sankarganesh86
Posts: 108
Joined: 06 Jan 2010, 09:50
Location: chennai
Contact:

Re: Highly Resilient Connection (HRC) system problem

Postby sankarganesh86 » 01 Dec 2017, 11:50

1) first we will run the client it shows, Connection failure msg
2) After we will start the server ...is there any event client will keep on checking server is up or down ?
3) Or we will put a Timer for to check the server "sfs.loadConfig("config.xml");" it will keep on calling until server is connected
4) If i do that...i got warning msg "[SFS - WARN] A connection attempt is already in progress"
5) I need to connect to server from client when ever server is up is there any chance ?

And we can able to set

<sessionMaxIdleTime>300</sessionMaxIdleTime>
<userMaxIdleTime>3000</userMaxIdleTime>

to unlimited ?
I create a application in AS3 and i connected to SFS2X server but after few minute it is disconnected , I checked the internet and wifi signals also all are good in the server logs there is no sign of disconnection, What will be the problem ?
Sankar.G
sankarganesh86
Posts: 108
Joined: 06 Jan 2010, 09:50
Location: chennai
Contact:

Re: Highly Resilient Connection (HRC) system problem

Postby sankarganesh86 » 04 Dec 2017, 12:47

I develop a game application in as3 ,I received a frequent disconnect from server side , I attach the server logs also
Please get the attachment !!!

Socket closed automatically, I don't know why ...

In Zone i set

<overrideMaxUserIdleTime>3000</overrideMaxUserIdleTime>

In Server I set

<sessionMaxIdleTime>2900</sessionMaxIdleTime>
<userMaxIdleTime>3000</userMaxIdleTime>

Please replay ASAP for the above post also ...
Attachments
socket.jpg
(149.14 KiB) Not downloaded yet
Sankar.G
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Highly Resilient Connection (HRC) system problem

Postby Lapo » 04 Dec 2017, 16:05

sankarganesh86 wrote:I create a application in AS3 and i connected to SFS2X server but after few minute it is disconnected , I checked the internet and wifi signals also all are good in the server logs there is no sign of disconnection, What will be the problem ?

The server never disconnects anyone unless the user is idle for a longer time than what is configured.
If you find that users are disconnected prematurely the problem is in the network. Typically it's the client connection, unless you're not using dedicated hosting for your server(s).

What to do... a simple way to keep a connection alive is to send a "ping" from client to server and back, which could be done with an extension call with no parameters. Every 1 minute for instance. Even less, if necessary though 1 minute is usually sufficient.

In the screenshot the disconnections seem to come from a local network, with addresses like 192.168.0.*
If that's the case I have no idea why it is happening. In a local network you should never see anything like that. I think you should investigate what is going on your side.

I can assure you that they are not initiated by SFS2X. In fact if they were you would see an additional message in the logs saying that the user was kicked because he's been idle for too long.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
sankarganesh86
Posts: 108
Joined: 06 Jan 2010, 09:50
Location: chennai
Contact:

Re: Highly Resilient Connection (HRC) system problem

Postby sankarganesh86 » 04 Dec 2017, 16:58

Hi Lapo,

As per your suggestion i create a extension and ask client to ping the server for every 30 seconds

6 Android tabs and 2 Systems are connected with the Local SFS2X server
Total 6+2 = 8 Clients

All clients will send ping request at every 30 seconds to SFS2X , At the time of starting all send and receive data but later on
One by one client got disconnected but 2 system is not disconnected it is steady

We didn't receive ping request from 6 tabs, Connection lost reason is "UN KNOWN"
Sankar.G

Return to “SFS2X ActionScript 3 API”

Who is online

Users browsing this forum: No registered users and 14 guests