Session Reconnection failure

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

prince_hao
Posts: 71
Joined: 30 Oct 2010, 04:35

Session Reconnection failure

Postby prince_hao » 22 Mar 2014, 05:19

Hi:
I have some confusion, why can appear the following error,
SENDING TO -------> { Id: 9, Type: DEFAULT, Logged: No, IP: 121.37.35.236:1926 }
12:29:24,704 WARN [com.smartfoxserver.v2.controllers.SystemController-1] controllers.SystemController - com.smartfoxserver.bitswarm.exceptions.SessionReconnectionException: Session Reconnection failure. The passed Session is not managed by the ReconnectionManager: java.nio.channels.SocketChannel[connected local=/xxx.xxx.xxx.xxx:9933 remote=/xxx.xxx.xxx.xxx:1926]
com.smartfoxserver.bitswarm.sessions.DefaultReconnectionManager.reconnectSession(DefaultReconnectionManager.java:146)
com.smartfoxserver.bitswarm.sessions.DefaultSessionManager.reconnectSession(DefaultSessionManager.java:383)
com.smartfoxserver.v2.controllers.system.Handshake.execute(Handshake.java:68)
com.smartfoxserver.v2.controllers.SystemController.processRequest(SystemController.java:131)
com.smartfoxserver.bitswarm.controllers.AbstractController.run(AbstractController.java:96)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
My customer service client and the server version are respectively 1.2.0 and 2.8.2.
help me!
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Session Reconnection failure

Postby Lapo » 22 Mar 2014, 09:57

The error is telling you that a client was disconnected and attempted to reconnect but it arrived too late. There is a timeout for users to reconnect, if the client takes too long they will get this error.

You can adjust the value via the AdminTool > ZoneConfigurator, the parameter is "User Reconnection Time".
We recommend a minimum of 10-15 seconds which can be higher depending on how your game logic can handle waiting another player to return.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
nino
Posts: 13
Joined: 13 Aug 2014, 11:16

Re: Session Reconnection failure

Postby nino » 18 Aug 2014, 11:17

Hi Lapo:
I still have this error. can you recommend for times:
- in my game zone: "user reconnection time frame", " user maximum idle"
- in server setting: "session maximum idle"

AND: is HRC active when "user reconnection time frame > 0" ?
Thanks Lapo, SFS is a great product!
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Session Reconnection failure

Postby Lapo » 18 Aug 2014, 16:58

user reconnection time frame: at least 10-15 seconds, but mostly depends on your game logic. Some games can wait for players for longer times.
user maximum idle: a good value is usually 120-240secs (2-4 minutes). If you need your game to be more permissive with inactivity raise it a bit.
session maximum idle: 20-30 seconds is recommended.

AND: is HRC active when "user reconnection time frame > 0" ?

Yes, correct.
Lapo

--

gotoAndPlay()

...addicted to flash games
nino
Posts: 13
Joined: 13 Aug 2014, 11:16

Re: Session Reconnection failure

Postby nino » 19 Aug 2014, 03:11

Thanks Lapo for your answer! can you explain some cases:

Case1:
- if set user reconnection time frame to 300seconds, i changed session maximum idle to 300seconds + x seconds. is that right? Because my game need reconnection time between 5minutes and 10 minutes.
- Use PING_PONG.
- i changed it, when user trys reconnect, i get this error: " com.smartfoxserver.bitswarm.exceptions.SessionReconnectionException: Session Reconnection failure. The passed Session is not managed by the ReconnectionManager" (version 2.8) or "Session Reconnection failure. Time expired for Session" (version 2.9)

Case2:
- if set "Time idle" to 300seconds and i don't care any field (reconnect time frame, session idle...) for setting. Or i changed it like your recommended.
- NOT use PING_PONG.
- After disconnect between 10s and 20s, or too long (5minute), reconnect is perfect. But no CONNECT_RESUME event to fire. Some thing wrong?

Case 3
- use default setting
- go to elevator
- CONNECTION_RETRY throw
-..... when use connected my server, i get this error: "The passed Session is not managed by the ReconnectionManager" and CONNECTION_LOST throw

so, how to config my zone and "server configurator" for reconnection on 5minutes and CONNECTION_RETRY to fire?
Last edited by nino on 19 Aug 2014, 08:16, edited 1 time in total.
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Session Reconnection failure

Postby Lapo » 19 Aug 2014, 08:03

Case1:
- if set user reconnection time frame to 300seconds, i changed session maximum idle to 300seconds + x seconds. is that right? Because my game need reconnection time between 5minutes and 10 minutes.
- Use PING_PONG.
- i changed it, when user trys reconnect, i get this error: " com.smartfoxserver.bitswarm.exceptions.SessionReconnectionException: Session Reconnection failure. The passed Session is not managed by the ReconnectionManager" (version 2.8) or "Session Reconnection failure. Time expired for Session" (version 2.9)


There's no need to change the "idle time" settings. It doesn't apply when the user is temporarily disconnected.
Since you have set reconnection time at 300sec, you can't expect the user to reconnect in 5 to 10 minutes, because 300sec = 5 min. After 5 min it won't be able to reconnect.

How do you trigger the disconnection when testing?
You have reported the error but you didn't specify if the reconnection attempt was done within the reconnection time frame. According to the error it wasn't.
Lapo

--

gotoAndPlay()

...addicted to flash games
nino
Posts: 13
Joined: 13 Aug 2014, 11:16

Re: Session Reconnection failure

Postby nino » 19 Aug 2014, 11:33

wwooaa. I have cleared "user reconnection time frame". Thanks Lapo. I changed it to 10seconds. In my client, i settings smartFox.SetReconnectionSeconds(120). So after client disconnected on 5minutes and re-connected, it get this error: "Session Reconnection failure. The passed Session is not managed by the ReconnectionManager"
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Session Reconnection failure

Postby Lapo » 19 Aug 2014, 11:41

In my client, i settings smartFox.SetReconnectionSeconds(120)

This is incorrect.
You should never touch that value. And we don't provide documentation for it for this very reason.

In order to user the Reconnection System all you have to do is setting the "reconnection time frame" on the server side. End of story. The rest is handled by the API.
By all means please remove any references in your client code to the SetReconnectionSeconds(...) method.
Lapo

--

gotoAndPlay()

...addicted to flash games
nino
Posts: 13
Joined: 13 Aug 2014, 11:16

Re: Session Reconnection failure

Postby nino » 25 Aug 2014, 05:18

ok. I spended too time for reconnection. My Investor want reconnect in less than 5minutes (go in, out the elevator). i am using Case 3:
- used default setting
- go to elevator
- CONNECTION_RETRY throw
-.... (go out). when use connected my server, i get this error: "The passed Session is not managed by the ReconnectionManager" and CONNECTION_LOST throw

Please tell me how to config my zone and "server configurator" for reconnection on 5minutes or more than? I need pass this case for my money to buy smartfox from my investor. sorry for poor question.
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Session Reconnection failure

Postby Lapo » 25 Aug 2014, 10:53

You will need to clarify what case #3 means:


- use default setting

default settings for which parameters? please be specific
- go to elevator

I am not sure what this means? What is the elevator in your application, why is it relevant to the reconnection scenario?
- CONNECTION_RETRY throw
-..... when use connected my server, i get this error: "The passed Session is not managed by the ReconnectionManager" and CONNECTION_LOST throw

Please explain how you are testing this scenario in detail. How do you test the disconnection?
Please make sure you read and understand this:
http://docs2x.smartfoxserver.com/Gettin ... n-hrc-plus

In particular the last section, where it is explained how to test the reconnection.

thanks
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 70 guests