none
Setting TCP ACK programmatically RRS feed

  • Question

  • Hi,
    I have a question regarding http://support.microsoft.com/kb/Q328890 (New registry entry controlling the TCP Acknowledgment (ACK) behavior in WindowsXP and Windows Server 2003). I would like to know whether an application can achieve the same effect programmatically.

    This problem scenario:
    1. Server creates a large buffer and keep writing (non blocking) to a connected (client) socket, until all data is written.
    2. Client reads(non blocking) using WSARecv, overlapped mode, until all data is being read. On this socket SO_SNDBUF or SO_RCVBUF is set to 56K.  The problem I see is this - the total elapsed time of every run (using a green LAN with server) varies. Some times the client runs super fast, some times slow..a totally inconsistent pattern between different runs.
    I tried http://support.microsoft.com/kb/Q328890, with the fix - setting TcpAckFrequenct to 1, the client started working great! It always gives consistent total elapsed time. Now, the question: Is there a way, I can have the same effect (of changing the registry) using programmatic way (using socket option/API calls)? 
    I tried TCP_NODELAY option both on the client socket as well as on the server side, but did not see any effect!

    Any help is really appreciated.

    thanks,
    Joseph

     

    Thursday, June 25, 2009 12:11 AM

All replies

  • Use WSAsend overlapped call the server . Pend as many as WSASend as possible. Asynchronus io calls makes things faster compared to  a synchronous io call.. Tweaking tcp parameter is not a good idea..
    Thursday, July 2, 2009 7:47 AM