I find out it can be delay 200ms on WinSock send call
From MSDN: http://support.microsoft.com/kb/214397/en
Nagle Algorithm: http://en.wikipedia.org/wiki/Nagle's_algorithm
Issue summary:
If send small msg(< MTU) with SO_SNDBUF "0" option repetedly, send function block 200ms.
My Question: Why first send message delay 200ms?
Because TCP is idle before first send call, I think first message must be sent immediately.
But Test result is not desired.
First message also delayed 200ms, why?
Thank you for answers.
Add some details:
Naggle algorithm work for small message like following:
1. if wire is idle, send it immediately.
2. if formal message's ACK is not received, wait until ACK & send
3. Window's TCP ack delay mechanism send ack after 200ms.
So, My expect is first message sends immediately and second message wait first message's ack for 200ms and so on.
Is this wrong?