Connection process is inredibly slow

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

Moderators: Lapo, Bax

genar
Posts: 137
Joined: 13 Jul 2017, 11:49

Connection process is inredibly slow

Postby genar » 31 Oct 2018, 19:58

Good evening !

Once my app starts, i try to connect to my smartfoxserver... sometimes it connects within a second or nearly instant... sometimes it takes up to 30 seconds. It always tells me that he connects using the socket approach... so i think it isnt because of bluebox... futhermore i have a incredible fast internet connection...

Here are my settings :

Code: Select all

        // Set connection parameters
        ConfigData cfg = new ConfigData();
        cfg.Host = hostIP;
        cfg.Port = port;
        cfg.Zone = worldZone;
        cfg.Debug = true;

        cfg.UseBlueBox = true;
        cfg.HttpPort = 8080;
        cfg.HttpsPort = 8443;
        cfg.BlueBoxPollingRate = 500;


Any ideas why its so slow sometimes ?

I also have a question... when does bluebox trys to connect ? Our proxy blocks my app traffic, so smartfoxserver gives me always a socketexception... but somehow it never connects via bluebox... and i have enabled bluebox client and server sided. Why does this happen ?
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Connection process is inredibly slow

Postby Lapo » 01 Nov 2018, 08:15

Hi,
a part from network issues there's nothing else that can slow down your connection times.
As you said BlueBox is the only exception, because in that case the socket attempt must timeout before the BlueBox connection can kick in.

If you try to connect to a SmartFox running on your local machine or local network you will see that connection times are always instantaneous.

If you have a bit of experience with the internals of TCP/IP, you can monitor the connection process with a tool such as wireshark to obtain more details about where exactly the process slows down, although it might not give you the exact reason why this happening.

Just as a curiosity is the server you're testing with located in the same country where you are?

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
genar
Posts: 137
Joined: 13 Jul 2017, 11:49

Re: Connection process is inredibly slow

Postby genar » 02 Nov 2018, 09:45

Lapo wrote:Hi,
a part from network issues there's nothing else that can slow down your connection times.
As you said BlueBox is the only exception, because in that case the socket attempt must timeout before the BlueBox connection can kick in.

If you try to connect to a SmartFox running on your local machine or local network you will see that connection times are always instantaneous.

If you have a bit of experience with the internals of TCP/IP, you can monitor the connection process with a tool such as wireshark to obtain more details about where exactly the process slows down, although it might not give you the exact reason why this happening.

Just as a curiosity is the server you're testing with located in the same country where you are?

Cheers


I set the same port for udp & tcp... is it possible that it tries to connect using udp, fails and then tries it again till it works with udp ? Or is the connection always tcp ?

Sometimes it connects instant... sometimes it takes minutes till the connection is sucessfull...
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Connection process is inredibly slow

Postby Lapo » 02 Nov 2018, 16:39

No, TCP and UDP ports can be the same value without problems.
When call SmartFox.Connect(...) you always star a TCP connection. So there's no possibility for conflicts.

Is SmartFoxServer running on a dedicated machine/network (i.e. using dedicated hosting) or is it running off of a home connection or something like that?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
genar
Posts: 137
Joined: 13 Jul 2017, 11:49

Re: Connection process is inredibly slow

Postby genar » 02 Nov 2018, 17:10

Lapo wrote:No, TCP and UDP ports can be the same value without problems.
When call SmartFox.Connect(...) you always star a TCP connection. So there's no possibility for conflicts.

Is SmartFoxServer running on a dedicated machine/network (i.e. using dedicated hosting) or is it running off of a home connection or something like that?

Thanks


Well actually its running on a dedicated server which i hosted... but the connection is pretty good actually... atleast the speed.
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Connection process is inredibly slow

Postby Lapo » 02 Nov 2018, 17:26

When you say "you hosted", what does it mean? From a home connection?
In any case if you want, we can test connecting from remote and see if have the same problem.

If we do see the same problem however, we'll not be able to help you solving it, other than recommending a dedicated hosting.

By the way you didn't answer my previous question: are the client and server in the same country?
Thanks

p.s. = if you want us to test from remote you can send me the server IP address in a private message.
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 78 guests