Connection takes too much time

Post here your questions about the Flash / Flex / Air API for SFS2X

Moderators: Lapo, Bax

noveltysoft
Posts: 39
Joined: 19 Sep 2012, 03:24

Connection takes too much time

Postby noveltysoft » 28 Jan 2013, 13:32

Hi,

I am facing an issue with Connecting to SmartFoxServer. My game is specific to South Asia region and people do not have very high internet speed due to which lot of users complaining me about Game is not Connecting and stuck on "Connecting to server". Even some user here still uses the Dialup connection. So you can see the possible issues. Is there any way to improve Connectivity speed?

Currently I am connecting through 8080 Port and using the same code you have provided in example http://docs2x.smartfoxserver.com/Develo ... tion-phase

I noticed that 8080 port has little slow response than port 80 and 443 (HTTPS). Might be due to 8080 port connection its taking bit longer. Is there any way I can setup fast connection? Or any way I can ask my hosting company to speed up 8080 port connection. Can I connect through port 443 or 80. I have SSL installed on my server.

Also I would like to know if port 80 and 443 is possible, then what are the consequences with regards to security?

My Game is www.facebook.com/courtpiece. Please go ahead and Play a Game, you will notice what happens when "Connecting to Server" message appear. It takes a bit of time. I need to speed this up and need to know all possible solutions for it and their consequences in return.

Thanks,
William
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Connection takes too much time

Postby Bax » 29 Jan 2013, 09:50

Are you sure the client are able to connect to the server via socket?
Unless you changed the settings, the socket connection port is 9933, and the 8080 is reserved to the BlueBox http connection. The fact that the client is stuck on the "Connecting to server..." might indicate that it is trying to connect via socket but it can't reach the server, and eventually it will switch to the BlueBox connection.
Paolo Bax
The SmartFoxServer Team
noveltysoft
Posts: 39
Joined: 19 Sep 2012, 03:24

Re: Connection takes too much time

Postby noveltysoft » 29 Jan 2013, 17:01

Hi,

Thank you for your response. I think I had my Bluebox setup to FALSE and that's why it was taking too long if no response from Socket. I just activate BB and here is my SFS Config file:

<SmartFoxConfig>

<!-- Mandatory Settings -->
<ip>68.168.107.138</ip>
<port>9933</port>
<zone>BasicExamples</zone>
<!-- End Mandatory Settings -->

<debug>false</debug>

<httpPort>8080</httpPort>
<useBlueBox>true</useBlueBox>
<blueBoxPollingRate>500</blueBoxPollingRate>

</SmartFoxConfig>

Let me know if you have any suggestions to improve Connectivity issues. I just did BlueBox to TRUE, do I need to Restart SFS ? or it will just work?

Regards,
William
noveltysoft
Posts: 39
Joined: 19 Sep 2012, 03:24

Re: Connection takes too much time

Postby noveltysoft » 29 Jan 2013, 17:03

By the way, I have domain www.courtpiece.com is running on same machine. So, I guess port 80 and 443 are occupied by Apache service.

Will it work if I enter Port 80 or 443 in SFS Config file?

Regards,
William
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Connection takes too much time

Postby Bax » 29 Jan 2013, 17:47

Wait. First of all you should fully understand what BlueBox is by reading the documentation.
Now, if you had the BlueBox connection turned off on the clients, and those clients are not able to connect, the reason is that they probably can't reach the server using the default socket connection.
This is what you should investigate.
1) If all users can't connect, it might depend on a firewall on your side, or maybe you hit the max number of concurrent users allowed by your license.
2) If just some of them can't connect, then it could depend on their own firewalls. In this case you might activate the BlueBox connection which could help more users to connect, even if the client-server communication performance will decrease.
3) If all users can connect in the end, but it takes a long time, you should provide more details: are you able to say if it is the connection taking too much time or the following login process? How much time does it take before the user can connect? Etc.
Paolo Bax
The SmartFoxServer Team
noveltysoft
Posts: 39
Joined: 19 Sep 2012, 03:24

Re: Connection takes too much time

Postby noveltysoft » 29 Jan 2013, 18:07

Hello Bax,

Thank you for your response. Yes, I read BlueBox documentation and I am pretty clear about it. Sorry for miss understanding earlier.

1) Ok, I just talked to my Server team and they confirmed me that both port 8080 and 9933 are opened. I tried TELNET it myself "telnet 68.168.107.138 9933" and it works perfect.

2) "maybe you hit the max number of concurrent users allowed by your license".. What does this mean? How can I verify that, how many concurrent users I have in my account currently.

3) i have no idea about average time taken by SFS, usually it wont take more than 8 seconds. But I have applied a check in my game that if connection didn't established with in 20 seconds. Then Refresh and trying to connect again. What do you say, how long it takes to connect with SFS?

4) I have activate my BlueBox, do I need to restart SFS? or it will just work?

Regards,
William
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Connection takes too much time

Postby Bax » 30 Jan 2013, 08:01

2) you can check the current number of CCU in the AdminTool's Dashboard module. Anyway if this is the case the client gets disconnected and an event is fired on the client. I assume you are handling disconnection events properly.

3) usually the connection process takes less than a second. Maybe a couple of seconds depending on the network traffic. The login process instead can differ, for example if you are validating the credentials against a database.

4) unless you turned off the SFS internal web server, no need to restart. I think you should monitor how many users connect through the BlueBox to further investigate your issue.
Paolo Bax
The SmartFoxServer Team
User avatar
Evil-Dog
Posts: 86
Joined: 08 Mar 2011, 17:59
Contact:

Re: Connection takes too much time

Postby Evil-Dog » 13 Dec 2014, 03:50

Sorry to revive this thread but I'm having the same issue with some people having very long connection times, 1 to 5 minutes sometimes. I read that BlueBox is active by default in SFS2X so what's left to check? I have a 2000CC license, it's only for a few users who reported this.
Help would be appreciated :)
Using SFS 2.9.0
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Connection takes too much time

Postby Lapo » 13 Dec 2014, 09:47

As you alluded to it has to do with the BlueBox connection.
More specifically, the client will first attempt to connect via socket. When this is not possible an error is eventually detected, but it's not deterministic. It can take some time, even quite a bit, like several seconds.

1 to 5 minutes sounds like an awful lot of time, which may indicate that those users are running a very, very slow connection. Possibly one that will not allow them to really enjoy tje multiplayer experience.

The Flash Player has a socket connection timeout that by default should fire within 20 seconds, but we reconfigure it to 5 seconds, so you shouldn't be waiting longer than that.

Of course this is just a part of the connection process. After 5 seconds and no successful connection the API will give up the socket route and attempt to connect via HTTP, this may take an extra 1-2 seconds.

All in all, worst case scenario, it should take no longer than 7-8 seconds max, to finally get connected. 10 seconds tops, if you're really unlucky.

You could provide the user more fine grained info about what is going on during the connection process, by listening to the SFSEvent.CONNECTION_ATTEMPT_HTTP event. This is notified when the socket connection has failed and the API is now trying the HTTP tunnel (BlueBox)

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Evil-Dog
Posts: 86
Joined: 08 Mar 2011, 17:59
Contact:

Re: Connection takes too much time

Postby Evil-Dog » 13 Dec 2014, 15:36

Yeah up to 10 seconds would be totally fine.
The guy did say he had bad lag when playing while for me it was totally fine so he might have a bad setup or something, not sure.
Anything else I could add to the client to get more info on this? I don't get many opportunity to get this particular client to give me info so if I can get it all in one shot, it would be great.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Connection takes too much time

Postby Lapo » 13 Dec 2014, 18:05

There isn't much else. All symptoms are indicative of a pretty slow / bad network.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Evil-Dog
Posts: 86
Joined: 08 Mar 2011, 17:59
Contact:

Re: Connection takes too much time

Postby Evil-Dog » 13 Dec 2014, 20:34

Ok well I'l listen to that event and see. Another thing is that my friend doesn't have a bad connection, we play on the version on my site and it worked but when the game is on this other site (big gaming site), then he got the super long delays as well as disconnects with no info. I even tried to restart the server and when he would log in, I'd get the "Login failed: [username], session is already expired!", basically, problems connecting all around for him.
User avatar
Evil-Dog
Posts: 86
Joined: 08 Mar 2011, 17:59
Contact:

Re: Connection takes too much time

Postby Evil-Dog » 14 Dec 2014, 02:36

Sadly, the client didn't get the attemptHTTP event. The connection took over 30 seconds.
My friend is also getting very long connection (5 minutes+) that turns into a disconnection message and on the server I get
Login failed: sickdeathfiend , session is already expired!

Now, on my own website it works instantly for this friend.
What could make the game on a website really different from another website? Like on armorgames.com: 5 minutes connection + disconnection message, my website: instant connection and no problem.
Any ideas?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Connection takes too much time

Postby Lapo » 15 Dec 2014, 10:04

For some reasons it seems your friend's ISP seems to be very slow with one of the two servers. This can happen for all kinds of reasons, including geographical position.
One could dig into the problem with tools such as ping, traceroute etc... to find out more details about the issue but none of them will solve it.

cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Evil-Dog
Posts: 86
Joined: 08 Mar 2011, 17:59
Contact:

Re: Connection takes too much time

Postby Evil-Dog » 15 Dec 2014, 17:07

I was hoping not to get to the "welp...it happens, can't do anything about it"
Hmm ok I'll try these tools

Return to “SFS2X ActionScript 3 API”

Who is online

Users browsing this forum: No registered users and 17 guests