Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
To Nagle or Not To Nagle?
#1
Well... while making MSECPP I'm having a little bit of problems with this. The Nagle algorithm is used by us, even if we don't realize. It's an algorithm at WinSocket that... well, just read this:
http://www.port80software.com/200ok/arc ... 1/317.aspx
I saw that in VBGore(http://www.vbgore.com/Nagle_Algorithm), Spodi removed it. But I really don't realize why exactly.
My real problem is that when I send 2 packets too much fast, they are just not received in the correct order... And I want to fix this chit xD

EDIT:
Btw, I think Verrigan fixed that by first sending the hole packetsize before anything, then reading that amount of data. Hummm, will that really work?
Reply
#2
Dave Wrote:If you're packets are arriving out-of-order, you're not using a TCP connection.

When Naggling, your computer will wait to send any packets until there is enough data to send. Turn it off, it will send immediately, even for small packets.
I am using TCP, but somehow they are not. That's reeeealy weird.
And the question was: Should a Mirage game use Nagle's algorithm or not?
Reply
#3
if it fixes it it would make sense right?
Reply
#4
Dragoons Master Wrote:I am using TCP, but somehow they are not. That's reeeealy weird.

Impossible. If you are dropping or receiving messages out of order in TCP, your implementation is flawed.

As for Nagling, it is nothing more than a buffer for queueing data to send. It will increase latency but also decrease bandwidth since it results in less headers (which is 40 bytes for TCP/IPv4). Ideally you want to create your own buffering. Have every "send" to a user queue the message instead of sending it to Winsock. Then define your own way of deciding when to send. You can do it once per server tick, once every X ms, etc. vbGORE uses a combination of a maximum queue time combined with message priorities to decide when to send. A message will always be sent in
Reply
#5
Spodi Wrote:your implementation was flawed
Fixed it. It was really a bad implementation, but now this damn code is giving me memory errors ><
I'll just finish translating everything then I'll release it to see if anybody can fix it.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)