CLOSE_WAIT Socket Problem
Posted: Thu Jul 11, 2013 12:51 am
Hi
I use createCallbackConnection() API, there are 2 TCP connection.
When RCF session timed out, it seems RCF framework could not gracefully shutdown socket.
client socket server socket
1st connection port 52545 ====> 50001
2nd connection port 52546 ====> 50001
When the session timed out, only 2nd TCP connection is closed (52546) at server side.
and 1st TCP connection & 2nd TCP connection are closed at client side.
So 1st TCP conecction(52545) is not closed at server side.
thus 1st socket is in the CLOSE_WAIT state at server side.
$ lsof -p 6228
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Server 6228 mang 9u IPv4 43863 0t0 TCP *:50001 (LISTEN)
Server 6228 mang 10u IPv4 46156 0t0 TCP localhost:50001->localhost:52545 (CLOSE_WAIT)
I attached the simple client/server source code to demonstrate this problem.
And also captured packets (wireshak).
I appreciated if you give me some help on this.
Thanks.
Mr.Lim
I use createCallbackConnection() API, there are 2 TCP connection.
When RCF session timed out, it seems RCF framework could not gracefully shutdown socket.
client socket server socket
1st connection port 52545 ====> 50001
2nd connection port 52546 ====> 50001
When the session timed out, only 2nd TCP connection is closed (52546) at server side.
and 1st TCP connection & 2nd TCP connection are closed at client side.
So 1st TCP conecction(52545) is not closed at server side.
thus 1st socket is in the CLOSE_WAIT state at server side.
$ lsof -p 6228
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Server 6228 mang 9u IPv4 43863 0t0 TCP *:50001 (LISTEN)
Server 6228 mang 10u IPv4 46156 0t0 TCP localhost:50001->localhost:52545 (CLOSE_WAIT)
I attached the simple client/server source code to demonstrate this problem.
And also captured packets (wireshak).
I appreciated if you give me some help on this.
Thanks.
Mr.Lim