Report Bug

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

Moderators: Lapo, Bax

Ardito
Posts: 128
Joined: 12 Sep 2016, 11:26
Location: Italy

Report Bug

Postby Ardito » 25 Sep 2019, 14:52

Hi,

When the server disconnects a user due to inactivity, if I have set low values in the SFS2x settings, the server notifies the disconnection to the client
Example:

Code: Select all

Socket addresses Type: TCP
Session maximum idle time: 10
User maximum idle time: 30
Overridden user maximum idle time: 30

While if I have high values, the server does not notify the client of the disconnection
Example:

Code: Select all

Socket addresses Type: TCP
Session maximum idle time: 30
User maximum idle time: 300
Overridden user maximum idle time: 300
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Report Bug

Postby Lapo » 25 Sep 2019, 16:27

Hi,
the server always disconnects a client that has been idle for too long.
Are you saying that the client does not detect a CONNECTION_LOST event? If so the problem might be of a different nature.

Can you tell me what kind of client are you testing with, what API version and what SFS2X version too?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
Ardito
Posts: 128
Joined: 12 Sep 2016, 11:26
Location: Italy

Re: Report Bug

Postby Ardito » 25 Sep 2019, 17:03

Lapo wrote:Are you saying that the client does not detect a CONNECTION_LOST event? If so the problem might be of a different nature.
Correct

Lapo wrote:Can you tell me what kind of client are you testing with, what API version and what SFS2X version too?
SmartFoxServer 2X v2.13.6
Unity 2019.2.6f1 (64-bit)
Client API SmartFoxServer 2X v1.7.8.1
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Report Bug

Postby Lapo » 26 Sep 2019, 06:51

What platform are you building for?
Can you describe how you're doing the test?
Is the test always reproducible?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
Ardito
Posts: 128
Joined: 12 Sep 2016, 11:26
Location: Italy

Re: Report Bug

Postby Ardito » 26 Sep 2019, 10:03

Lapo wrote:What platform are you building for?
Unity Editor

Lapo wrote:Can you describe how you're doing the test?
I start Unity Editor, I log in, and I wait

Lapo wrote:Is the test always reproducible?
Yes
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Report Bug

Postby Lapo » 26 Sep 2019, 14:08

Ardito wrote:
Lapo wrote:What platform are you building for?
Unity Editor

Yes, but what is your build target?
Even from the Editor that's relevant. For example if you're building for WebGL the Editor is going to use websockets, rather than TCP socket to communicate.

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
Ardito
Posts: 128
Joined: 12 Sep 2016, 11:26
Location: Italy

Re: Report Bug

Postby Ardito » 26 Sep 2019, 17:37

My build target is iOS and Android
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Report Bug

Postby Lapo » 27 Sep 2019, 09:37

I don't know how to reproduce this.
If you take any of our examples and test it locally you will get disconnected when the idle timer is expired. Long timer or short time, doesn't change the fact that you get the disconnection event.

Are you testing online perhaps? If so, it's more likely to be a network issue.
Let us know.
Lapo

--

gotoAndPlay()

...addicted to flash games
Ardito
Posts: 128
Joined: 12 Sep 2016, 11:26
Location: Italy

Re: Report Bug

Postby Ardito » 27 Sep 2019, 12:02

Yes I am testing on the net, the steps I do are these:

1) I log in through any user
2) I wait for the 300 seconds to expire

I tried again and now it works, but when I log in again, I get this error:

Code: Select all

14:08:12,109 INFO  [SocketReader] sessions.DefaultSessionManager     - Session created: { Id: 12, Type: DEFAULT, Logged: No, IP: 80.122.117.224:51676 } on Server port: 9933 <---> 51676
14:08:12,115 WARN  [SFSWorker:Sys:3] v290.SystemReqController     - com.smartfoxserver.bitswarm.exceptions.SessionReconnectionException: Session Reconnection failure. The passed Session is not managed by the ReconnectionManager: java.nio.channels.SocketChannel[connected local=/192.168.1.5:9933 remote=/80.122.117.224:51676]
        com.smartfoxserver.bitswarm.sessions.DefaultReconnectionManager.reconnectSession(DefaultReconnectionManager.java:155)
        com.smartfoxserver.bitswarm.sessions.DefaultSessionManager.reconnectSession(DefaultSessionManager.java:383)
        com.smartfoxserver.v2.controllers.system.Handshake.execute(Handshake.java:68)
        com.smartfoxserver.v2.controllers.v290.SystemReqController.processRequest(SystemReqController.java:172)
        com.smartfoxserver.v2.controllers.v290.SystemReqController.enqueueRequest(SystemReqController.java:127)
        com.smartfoxserver.bitswarm.io.protocols.AbstractProtocolCodec.dispatchRequestToController(AbstractProtocolCodec.java:39)
        com.smartfoxserver.v2.protocol.SFSProtocolCodec.dispatchRequest(SFSProtocolCodec.java:133)
        com.smartfoxserver.v2.protocol.SFSProtocolCodec.onPacketRead(SFSProtocolCodec.java:90)
        com.smartfoxserver.v2.protocol.binary.BinaryIoHandler$1.run(BinaryIoHandler.java:477)
        java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        java.lang.Thread.run(Unknown Source)
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Report Bug

Postby Lapo » 27 Sep 2019, 14:41

How are you logging in again? From the same client?
If so are you recreating the main SmartFox object. Every time you start a new connection from the same application you need to remove the listener from the previous instance and create a new one.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
Ardito
Posts: 128
Joined: 12 Sep 2016, 11:26
Location: Italy

Re: Report Bug

Postby Ardito » 27 Sep 2019, 18:46

Yes, in my game after a user becomes inactive, I take him to the Login screen.
Ardito
Posts: 128
Joined: 12 Sep 2016, 11:26
Location: Italy

Re: Report Bug

Postby Ardito » 28 Sep 2019, 08:42

Again, the client does not receive the inactivity disconnection.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Report Bug

Postby Lapo » 28 Sep 2019, 09:00

Ardito wrote:Again, the client does not receive the inactivity disconnection.

You just said that it did.

In your previous post you said:

1) I log in through any user
2) I wait for the 300 seconds to expire

I tried again and now it works, but when I log in again, I get this error...

So I assumed you were getting the disconnection event.
Now I am confused. Can you clarify?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
Ardito
Posts: 128
Joined: 12 Sep 2016, 11:26
Location: Italy

Re: Report Bug

Postby Ardito » 28 Sep 2019, 09:02

I don't understand it, sometimes it works, and sometimes it doesn't work
Ardito
Posts: 128
Joined: 12 Sep 2016, 11:26
Location: Italy

Re: Report Bug

Postby Ardito » 28 Sep 2019, 18:03

did some tests:

Code: Select all

Socket addresses Type: TCP
Session maximum idle time: 10
User maximum idle time: 30
Overridden user maximum idle time: 30
WORK

Socket addresses Type: TCP
Session maximum idle time: 10
User maximum idle time: 60
Overridden user maximum idle time: 60
WORK

Socket addresses Type: TCP
Session maximum idle time: 10
User maximum idle time: 120
Overridden user maximum idle time: 120
WORK

Socket addresses Type: TCP
Session maximum idle time: 10
User maximum idle time: 200
Overridden user maximum idle time: 200
WORK

Socket addresses Type: TCP
Session maximum idle time: 10
User maximum idle time: 250
Overridden user maximum idle time: 250
WORK

Socket addresses Type: TCP
Session maximum idle time: 10
User maximum idle time: 280
Overridden user maximum idle time: 280
DOESN'T WORK

Socket addresses Type: TCP
Session maximum idle time: 10
User maximum idle time: 300
Overridden user maximum idle time: 300
DOESN'T WORK

Socket addresses Type: TCP
Session maximum idle time: 30
User maximum idle time: 200
Overridden user maximum idle time: 200
WORK

Socket addresses Type: TCP
Session maximum idle time: 30
User maximum idle time: 300
Overridden user maximum idle time: 300
DOESN'T WORK

Socket addresses Type: TCP
Session maximum idle time: 60
User maximum idle time: 300
Overridden user maximum idle time: 300
DOESN'T WORK

Socket addresses Type: TCP
Session maximum idle time: 30
User maximum idle time: 350
Overridden user maximum idle time: 350
DOESN'T WORK

Socket addresses Type: TCP
Session maximum idle time: 60
User maximum idle time: 350
Overridden user maximum idle time: 350
DOESN'T WORK


My conclusion is:
When "User maximum idle time" is greater than 250 seconds, the client does not receive the Logout event.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 45 guests