[Live-devel] Server socket not closed after TCP request from client

Warren Young warren at etr-usa.com
Mon Nov 25 14:04:50 PST 2013


On 11/25/2013 13:54, Bruno Abreu wrote:
>
> What we've noticed is that after the TEARDOWN from each client we can see a
> socket left in CLOSE_WAIT state.

That means the client sent FIN, the server stack sent ACK, and nothing 
else happened.  Because TCP is bidirectional, the server is allowed to 
continue sending data to the client, but in most protocols, the server 
closes down its sending half shortly after the client sends its FIN, 
indicating that it won't be sending any more data.

A quick peek into the networking code suggests the problem may be in 
Groupsock::handleRead().  There isn't an "else" clause at line 312 in 
Groupsock.cpp, handling a 0 return from readSocket(), which is what 
happens when the server stack gets that FIN.


More information about the live-devel mailing list