![]() |
To Nagle or Not To Nagle? - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17) +---- Thread: To Nagle or Not To Nagle? (/showthread.php?tid=1976) |
To Nagle or Not To Nagle? - Dragoons Master - 28-07-2008 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? Re: To Nagle or Not To Nagle? - Dragoons Master - 28-07-2008 Dave Wrote:If you're packets are arriving out-of-order, you're not using a TCP connection.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? Re: To Nagle or Not To Nagle? - grimsk8ter11 - 30-07-2008 if it fixes it it would make sense right? Re: To Nagle or Not To Nagle? - Spodi - 30-07-2008 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 Re: To Nagle or Not To Nagle? - Dragoons Master - 30-07-2008 Spodi Wrote:your implementation was flawedFixed 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. |