Extension requests and TCP packets

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

Moderators: Lapo, Bax

brockemon
Posts: 54
Joined: 25 Jan 2012, 17:20

Extension requests and TCP packets

Postby brockemon » 16 Sep 2019, 22:00

Hi,

Just wondering if there is any automatic grouping of extension requests into single TCP packets. If not, are we guaranteed that every call to Send will be a new packet?

Edit: To clarify what I am asking. We are optimizing our game. I am measuring our main game extension response handler gets around 50-60 messages per second. Trying to ensure the TCP packet count portion of that is < 20 as recommended and trying to figure out how to count this.

-Brock
User avatar
Lapo
Site Admin
Posts: 21012
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Extension requests and TCP packets

Postby Lapo » 17 Sep 2019, 08:13

brockemon wrote:Hi,

Just wondering if there is any automatic grouping of extension requests into single TCP packets. If not, are we guaranteed that every call to Send will be a new packet?

It depends on the status of the TCP's Nagle algorithm settings.
By default the latest SFS2X 2.13 disables it, so multiple responses cannot be aggregated in one packet.
This also helps reducing latency as otherwise the TCP stack would be waiting a certain amount of ms to potentially aggregate multiple outgoing packets.

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
brockemon
Posts: 54
Joined: 25 Jan 2012, 17:20

Re: Extension requests and TCP packets

Postby brockemon » 17 Sep 2019, 15:39

Would love for an option to mark certain packets to be grouped while others send immediately :)
User avatar
Lapo
Site Admin
Posts: 21012
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Extension requests and TCP packets

Postby Lapo » 17 Sep 2019, 16:30

brockemon wrote:Would love for an option to mark certain packets to be grouped while others send immediately :)

You can always aggregate the data you want to transmit in one "Send" operation yourself.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
brockemon
Posts: 54
Joined: 25 Jan 2012, 17:20

Re: Extension requests and TCP packets

Postby brockemon » 17 Sep 2019, 20:33

Good idea! We implemented this grouping this morning and got our Extension Requests down to 13 per second vs 60 per second as it was before.

The real issue we are trying to address is reducing our wireless latency. We have noticed that our wired latency sits at around 65-80ms where as our wireless latency is 110ms-170ms. We were hoping that reducing the packets per second would help this. Is this largely out of our control or is there something we could be missing. Grouping the packets may have made it slightly better but hasn't fixed the issue.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 6 guests