| Mirage Source http://www.miragesource.net/forums/ |
|
| To Nagle or Not To Nagle? http://www.miragesource.net/forums/viewtopic.php?f=201&t=4071 |
Page 1 of 1 |
| Author: | Dragoons Master [ Mon Jul 28, 2008 5:20 pm ] |
| Post subject: | To Nagle or Not To Nagle? |
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? |
|
| Author: | Lea [ Mon Jul 28, 2008 5:25 pm ] |
| Post subject: | Re: To Nagle or Not To Nagle? |
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. |
|
| Author: | Dragoons Master [ Mon Jul 28, 2008 5:32 pm ] |
| Post subject: | Re: To Nagle or Not To Nagle? |
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? |
|
| Author: | grimsk8ter11 [ Wed Jul 30, 2008 2:51 pm ] |
| Post subject: | Re: To Nagle or Not To Nagle? |
if it fixes it it would make sense right? |
|
| Author: | Spodi [ Wed Jul 30, 2008 8:53 pm ] |
| Post subject: | Re: To Nagle or Not To Nagle? |
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 <= its maximum defined time, or if the buffer fills. |
|
| Author: | Dragoons Master [ Wed Jul 30, 2008 10:01 pm ] |
| Post subject: | Re: To Nagle or Not To Nagle? |
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. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|