Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a client server application running in: Server: Windows server 2008 R2 [Standard] Client: Windows XP SP3

Workflow: Server listens for client connections at port YY. Client connects to server at port YY. Data gets transferred from Server to Client. Server closes the socket ( with reuse option, TF_REUSE_SOCKET) Client closes the socket.

Problem: In normal scenarios when the data transfer is finished the server closes the socket and everything works fine. But in scenarios when Client closes the socket first ( for cancelling the data transfer) then the socket state @ server changes to CLOSED_WAIT ( as server recieves FIN from client). At client side the socket state in FIN_WAIT_2. This socket state remains forever. The sockets are not released at all.

The same application works fine if the server is also WindowsXP XP3.

IS there any settings in Windows2008 R2 which makes my application to not to release the socket ( or change the socket state from CLOSED_WAIT) ?

Note: I configured [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters] TcpFinWait2Delay = 60 But of no use.

share|improve this question

The client is not receiveing an ACK from the server for the FIN it sent to the server. I would recommend putting a packet capture on the client and the server to see what's happening.

share|improve this answer

The server code is broken. It is not calling CloseSocket (or the equivalent in the API you are using) and so its handle to the connection never closes.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.