Server Refuses Connection That Uses Winsock Listen() Call Backlog Parameter (295079)



The information in this article applies to:

  • Microsoft Windows 2000 Server SP1
  • Microsoft Windows 2000 Advanced Server SP1
  • Microsoft Windows 2000 Professional SP1

This article was previously published under Q295079

SYMPTOMS

When you use the Winsock listen() call backlog parameter, the server may refuse the connection. This can prevent passing of Windows Hardware Quality Labs (WHQL) tests, making it difficult for you to get certified for Winsock Direct.

CAUSE

This behavior can occur if the available listen backlog has become 0 instead of 1. When server side calls an accept() parameter, this increments the available backlog by 1. However, this increment does not take place until the program thread is preempted. The server refuses a connection attempt during this time.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Windows 2000 Service Pack 2.

RESOLUTION

To resolve this problem, obtain the latest service pack for Windows 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

260910 How to Obtain the Latest Windows 2000 Service Pack

MORE INFORMATION

When a connection-oriented Winsock program is accepting incoming connections, a socket is created by calling socket() and bind(), a backlog for incoming connections is specified with listen(), and then the connections are accepted with accept().

The listen() function has a backlog parameter that specifies the maximum length of the pending-connection queue, where connection requests reside while they wait for the server program to execute the accept() call. The maximum value of the backlog parameter varies, depending on what version of Windows NT you are running. If a connection request is received and the pending-connection queue is full, Windows NT issues TCP/IP resets on subsequent connection requests.

Modification Type:MajorLast Reviewed:11/19/2003
Keywords:kbbug kbfix KB295079