connection drops when client triggers game level command

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

Moderators: Lapo, Bax

sitnik
Posts: 19
Joined: 24 Jan 2018, 08:49

connection drops when client triggers game level command

Postby sitnik » 25 Feb 2018, 11:35

Hi ,

I using Smartfox sever 2.9, patched to 2.11.

Please have a look on the smartfox logs

[ 2.11.1 ]

25 Feb 2018 | 16:13:01,880 | INFO | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer | | SmartFoxServer 2X (2.11.1) READY!
25 Feb 2018 | 16:13:03,900 | INFO | main | bluebox.v3.SessionFilter | | BlueBox-2X Service (3.0.2) READY.
25 Feb 2018 | 16:13:23,191 | INFO | pool-1-thread-4 | entities.managers.SFSRoomManager | | Room created: { Zone: ToadsGame }, [ SFSGame: FIGHT8-1066, Id: 2, Group: default, public: true, minPlayers: 0 ]
25 Feb 2018 | 16:13:23,241 | INFO | pool-1-thread-4 | entities.managers.SFSRoomManager | | Room created: { Zone: ToadsGame }, [ SFSGame: FIGHT8-1067, Id: 3, Group: default, public: true, minPlayers: 0 ]
25 Feb 2018 | 16:13:23,302 | INFO | pool-1-thread-4 | entities.managers.SFSRoomManager | | Room created: { Zone: ToadsGame }, [ SFSGame: FIGHT8-1068, Id: 4, Group: default, public: true, minPlayers: 0 ]
25 Feb 2018 | 16:13:23,405 | INFO | pool-1-thread-4 | entities.managers.SFSRoomManager | | Room created: { Zone: ToadsGame }, [ SFSGame: FIGHT8-1069, Id: 5, Group: default, public: true, minPlayers: 0 ]
25 Feb 2018 | 16:13:23,432 | INFO | pool-1-thread-4 | entities.managers.SFSRoomManager | | Room created: { Zone: ToadsGame }, [ SFSGame: FIGHT8-1070, Id: 6, Group: default, public: true, minPlayers: 0 ]
25 Feb 2018 | 16:15:48,644 | INFO | SocketReader | bitswarm.sessions.DefaultSessionManager | | Session created: { Id: 1, Type: DEFAULT, Logged: No, IP: 127.0.0.1:53234 } on Server port: 9933 <---> 53234
25 Feb 2018 | 16:15:48,984 | INFO | SFSWorker:Ext:4 | v2.api.SFSApi | | User login: { Zone: ToadsGame }, ( User Name: user1, Id: 0, Priv: 0, Sess: 127.0.0.1:53234 ) , Type: Android
25 Feb 2018 | 16:15:49,098 | INFO | SFSWorker:Ext:5 | util.executor.SmartThreadPoolExecutor | | Shutting down old backup threads
25 Feb 2018 | 16:16:16,410 | INFO | SFSWorker:Sys:1 | v2.api.SFSApi | | Room joined: [ SFSGame: FIGHT8-1068, Id: 4, Group: default, public: true, minPlayers: 2 ], { Zone: ToadsGame }, ( User Name: user1, Id: 0, Priv: 0, Sess: 127.0.0.1:53234 ) , asSpect: false
25 Feb 2018 | 16:17:29,819 | INFO | SocketReader | bitswarm.sessions.DefaultSessionManager | | Session removed: { Id: 1, Type: DEFAULT, Logged: Yes, IP: 127.0.0.1:53234 }
25 Feb 2018 | 16:17:29,863 | INFO | SFSWorker:Sys:2 | v2.api.SFSApi | | User disconnected: { Zone: ToadsGame }, ( User Name: user1, Id: 0, Priv: 0, Sess: 127.0.0.1:53234 ) , SessionLen: 100878, Type: Android


Everything works fine till room join

after room join
BELOW ARE ALL GAME LEVEL INTERACTIONS
1.client send packetA to server
2.server send packetB & C to client in response to packet A
3.now after X seconds, client sends PacketD to server
4.packetD received at server and gets processed and server send packet E & F to client in response to packetD
5.These packet E & F are not received to client as a Disconnection or ConnectionRetry event gets triggered on server at this moment(due to unknown reasons), and causes the session to close on server side.

Also Disconnection or ConnectionRetry Events are getting triggered on client as well.

I am not able to understand whats special about this packetD which causes the problem, whenever gets processed on server side.
One thing i am sure about whenever client triggers this packetD , the problem arises.

Please let me know what could be possible cause of this disconnection or connection retry event on server side.

Few things i am confident about are:
-Network connection is totally fine as all setup is at localhost level.
-Client has not triggered this disconnection event
-This issue wont happen if client do not triggers packetD.
-Connection is not idle as continuous keepalive packets are sent to server in the backgroundat zone level.

Let me know if few other details are required to explain the problem
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: connection drops when client triggers game level command

Postby Lapo » 26 Feb 2018, 08:54

Hi,
a couple of things I've noticed:

1- Between the join and the disconnection there are 73 seconds. Is it possible you have configured the server to kick users idle after a too short period of time?

AlsoI see this line in the logs which is somewhat interesting:
25 Feb 2018 | 16:15:49,098 | INFO | SFSWorker:Ext:5 | util.executor.SmartThreadPoolExecutor | | Shutting down old backup threads

This indicate that earlier the server was under some stress and had to add more threads to keep up with the work.
Maybe this is not related to your problem but I find it odd that it happens locally, where I presume you're not running hundreds or thousands of clients... or am I wrong?

Code: Select all

1.client send packetA to server
2.server send packetB & C to client in response to packet A
3.now after X seconds, client sends PacketD to server
4.packetD received at server and gets processed and server send packet E & F to client in response to packetD
5.These packet E & F are not received to client as a Disconnection or ConnectionRetry event gets triggered on server at this moment(due to unknown reasons), and causes the session to close on server side.

This is where I can't follow. What are exactly these packet A, B, C, D etc...?

Also please specify what client API you're using and which version.
Finally are you running any software firewalls on your test machine(s)? Maybe something like ZoneAlarm?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 89 guests