![]() Modify the send call or the WSASend call to specify a buffer size at least 1 byte smaller than the SO_SNDBUF value. ![]() When you are finished, the SO_SNDBUF value must be at least 1 byte larger than the program send buffer size. To modify the socket send buffer, use the Windows Sockets getsockopt function to determine the current socket send buffer size (SO_SNDBUF), and then use the setsockopt function to set the socket send buffer size. Method 2: Make the socket send buffer size larger than the program send buffer size For more information about blocking and non-blocking socket programming, see the Microsoft Platform SDK documentation. When you use a blocking socket, this problem does not occur because afd.sys handles the socket buffer differently. This problem only occurs with non-blocking sockets. To work around this problem, use any of the following methods. The remote TCP server acknowledges all the TCP segments before the client sends the last TCP segment with the push bit set. By default in a Windows environment, this may take as long as 200 ms because of the delayed acknowledgment algorithm. In this scenario, the select function does not report the socket as writable until the client receives the outstanding TCP ACK segment. Most programs use the Windows Sockets select function to check the status of the socket. After it calls the WSAGetLastError function, the program receives the WSAEWOULDBLOCK error code. In this scenario, each time the program issues a send call of 64 KB of data, the program returns a SOCKET_ERROR error code if the underlying 32-KB socket buffer is filled. Later, when the program sends data, it issues a send call or a WSASend call and sends 64 KB of data during each send: send(socket, pWrBuffer, 65536, 0) The Windows Sockets program uses non-blocking sockets.Ī single send call or WSASend call fills the whole underlying socket send buffer.įor example, the program uses the Windows Sockets setsockopt function to change the default socket send buffer to 32 KB during its socket initialization routines: setsockopt( sock, SOL_SOCKET, 32768, (char *) &val, sizeof( int )) This problem occurs if all the following conditions are true: This problem occurs because of the architectural behavior of the Windows Sockets API and afd.sys. ![]() A typical data flow for sending 64 kilobytes (KB) of data looks similar to the following sequence: By default, for Windows operating systems, the value for this timer is 200 milliseconds (ms). If you make a network trace with a network sniffer such as Microsoft Network Monitor, the TCP server sends a TCP ACK segment to the last TCP segment in a TCP data stream in the delayed acknowledgment timer (also known as the delayed ACK timer). When you run a program that uses the Windows Sockets API, you may experience slow performance when you copy data to a TCP server. This article provides workarounds for the issue where slow performance occurs when you copy data to a TCP server by using a Windows Sockets API program.Īpplies to: Windows Server 2012 R2, Windows 10 - all editions Original KB number: 823764 Symptoms
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |