Unexpected Delay in TCP Streams
-
I have a quick question (okay maybe not so quick) about timing and controlling the TCP/IP stack in windows. I developed a communications stack for an application that has to support large file tranports and smaller messages across TCP connection. The smaller (< 1K) control messages seem to work fine and the stack is able to communicate. However when I drop the big 10K message on the stack, it all seems to be writing correctly, however I am seeing a significant delay of 3 seconds between each 1k Window going out. (Note the TCP ACK comes back in around 9ms.) This 3 second delay (30 seconds total to send all 10K) seems a bit of a waste. I am going to continue to test and see if it is my machine but I believe it must be a property of the sockets. One other note is that if I send a continuous stream of the small control messages, there is no 3 second delay between packets. I set up the socket as an overlapped socket:
m_Socket = WSASocket(AF_INET, SOCK_STREAM, IPPROTO_IP, NULL, 0, WSA_FLAG_OVERLAPPED);
I then set the keep alive mode on, bind it to a local port, and then connect to the remote box. That all seems to work fine, except when I rely on the TCP window streaming mechanics I get that delay. The remote side even says that I have another 7K available in it's window that I could send. Is there some sort of TCP window parameter that I cannot find in the documentation?? Thanks, Brian If you start a fire for a man, he will be warm for a day. If you start that same man on fire, he will be warm for the rest of his life.