Page 1 of 1

Socket connection timeout problem

Posted: 01 Apr 2014, 11:31
by danielalbu
Hi,
We are experiencing problems with connecting to the SmartFox server from certain computers,
It seems that the socket connection timeout is 5 seconds in the SmartFox AS3 API and cannot be configured like regular socket objects in AS3 (http://helpx.adobe.com/flash/kb/flash-p ... ction.html)

Is it possible to change the timeout of the socket?
It is crucial since we believe that the computers which experience these problems would be able to connect had the timeout been longer (and thus allowing the computers more time to connect)

Thank you in advance.

Re: Socket connection timeout problem

Posted: 02 Apr 2014, 08:22
by Lapo
Since Flash Player 10, Adobe has added a way to control the socket timeout.
http://help.adobe.com/en_US/FlashPlatfo ... ml#timeout

You can try adding this line of code after the instantiation of the SmartFox class:

Code: Select all

import com.smartfoxserver.v2.kernel;
...
var sfs:SmartFox = new SmartFox()
sfs.kernel::socketEngine.socket.timeout = 5000


The value is expressed in milliseconds, according to Adobe's doc the default is 20 seconds. I wouldn't recommend using values < 3-4 seconds.

Re: Socket connection timeout problem

Posted: 03 Apr 2014, 21:02
by danielalbu
Thank you, Lapo

Re: Socket connection timeout problem

Posted: 11 Apr 2017, 09:30
by adnan
Guys,
Hope you are doing well.
Anybody solved this issue ?
I want to handle it in Unity Game.
Please guys give me a help.


Thanks,

Re: Socket connection timeout problem

Posted: 11 Apr 2017, 15:18
by Lapo
Then please start a new thread in the Unity section and explain what is the problem exactly and what API version you're using.
Thanks

Re: Socket connection timeout problem

Posted: 28 Aug 2021, 06:07
by shahidbits2012
@lapo how can we specify the connection timeout in SFS Java Client?

We are observing that the players are keep on trying to connect to the server internally for a very long time and eventually disconnects.
We want to explicitly drop the connection when the user is not connected within X secs and try again.

Please help!

Re: Socket connection timeout problem

Posted: 30 Aug 2021, 08:48
by Lapo
@shahidbits2012: I've already replied to your other topic, let's keep the conversation in one place.