How to Reconnect to the smart fox server

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

Moderators: Lapo, Bax

javaSan
Posts: 4
Joined: 15 Jan 2018, 06:54

How to Reconnect to the smart fox server

Postby javaSan » 15 Feb 2018, 04:15

Hi,
I want to reconnect player in game room after disconnect . how can i do this?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to Reconnect to the smart fox server

Postby Lapo » 15 Feb 2018, 09:04

Hi,
if the disconnection is due to a temporary network error/hiccup this will usually help:
http://docs2x.smartfoxserver.com/Gettin ... n-hrc-plus

You just need to activate the reconnection system from the AdminTool and give it a reasonable reconnection time (typically 30-60 seconds)
The client API will do the rest (i.e. attempt to reconnect when disconnected)

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
javaSan
Posts: 4
Joined: 15 Jan 2018, 06:54

Re: How to Reconnect to the smart fox server

Postby javaSan » 15 Feb 2018, 09:20

I want know about client side working to reconnect . How can client side work?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to Reconnect to the smart fox server

Postby Lapo » 15 Feb 2018, 11:27

The client detects a disconnection and retries to connect to the server.
On the other side (server) the old session is still alive and waiting for the old owner to come back. If this happens within the time limit you've configured the old session is revived and you're good to go.

If you want to learn more about disconnections I highly recommend these two articles from our blog:
http://smartfoxserver.com/blog/what-rea ... tworkwifi/
http://smartfoxserver.com/blog/handling ... e-devices/

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 33 guests