when users pull the plug

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

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

Postby Lapo » 12 Apr 2006, 14:44

are the 2 parallel servers physically on the same machine?
are they the same version?
do they use the same zone configuration?
Lapo
--
gotoAndPlay()
...addicted to flash games
CanOncel
Posts: 12
Joined: 20 Jul 2016, 11:18

Re:

Postby CanOncel » 20 Oct 2016, 12:21

Lapo wrote:That's what we call "sloppy disconnections" :) And they can happen more often than you can imagine.

The example you provided is just one of those cases. If you want to do a better experiment try this:

- start the server on one machine
- launch a client on another machine and establish a connection
- now check the connections on the server using netstat (under Windows open a console window and type "netstat"). You will notice the client-server connection in ESTABLISHED status
- now pull the ethernet cable off the client machine
- go back to the server and keep checking the netstat... you'll be amazed in seeing that the connection is still there!! :shock:

That's why SmartFoxServer doesn't handle the disconnection, because the lower level TCP layer didn't catch it too :)

Anyways SFS deals with the problem efficiently by automatically closing all idle connections as specified in the <MaxUserIdleTime> parameter in the config.xml

So, even if you have thousands of those garbage connections, SFS will shut them down automagically

Hope it helps :)


Hello Lapo,

Is there any way to handle disconnection for Unity or AS3?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Re:

Postby Lapo » 20 Oct 2016, 13:51

CanOncel wrote:Is there any way to handle disconnection for Unity or AS3?

Hi,
your question is too vague, sorry. What does it mean "handling disconnections"?
In which way you want to handle a disconnection?

There's a client side event for that. Unless you're asking for how to reconnect after a connection loss. In which cases I'd recommend reading this: http://docs2x.smartfoxserver.com/Gettin ... n-hrc-plus

cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
CanOncel
Posts: 12
Joined: 20 Jul 2016, 11:18

Re: Re:

Postby CanOncel » 21 Oct 2016, 06:15

Lapo wrote:
CanOncel wrote:Is there any way to handle disconnection for Unity or AS3?

Hi,
your question is too vague, sorry. What does it mean "handling disconnections"?
In which way you want to handle a disconnection?

There's a client side event for that. Unless you're asking for how to reconnect after a connection loss. In which cases I'd recommend reading this: http://docs2x.smartfoxserver.com/Gettin ... n-hrc-plus

cheers


Hello Lapo,

I tested my program by turning Wi-Fi on/off. I recognize that isConnected() function is still true, when Wi-Fi is turned off. Is there a way of check connection?

On the other hand, I also defined SFSEvent.CONNECTION_LOST, but when Wi-Fi is turned off, the callback is not called.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: when users pull the plug

Postby Lapo » 21 Oct 2016, 07:43

Turning off the Wifi does not close your connections. This has nothing to do with SmartFox, it's how TCP works.

We ha discussed this many times:
viewtopic.php?f=18&t=18224&p=79511
viewtopic.php?f=18&t=18743&p=81832

For more see also:
http://docs2x.smartfoxserver.com/Gettin ... n-hrc-plus

cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 37 guests