What is the state of a TCP socket after a remote close?

Let's say I accepted () a connection to my server (which runs on Solaris) and the client closed the connection. What is the socket state (in netstat categories) of the server side socket before I close () it on the server side? Is it BOUND?

0


source to share


5 answers


It will be CLOSE_WAIT, see tcp status diagram for example. at http://en.wikipedia.org/wiki/File:Tcp_state_diagram_new.svg



+7


source


In this situation, the socket on the client will be in TIME_WAIT, and the socket on the server will go through CLOSE_WAIT and move quickly to CLOSED so that you can't catch it in netstat before it disappears from the list.



+1


source


It should be CLOSE_WAIT

, since the end that is entering FIN

first goes to TIME_WAIT

---> CLOSED

.

In this it is launched by the first client. So the server will go to CLOSE_WAIT

.

0


source


CLOSE_WAIT

you can check:

ps auxf

lsof -a -p [server_process_id]

you get: sock 0.8

state 8: TCP_CLOSE

0


source


I think TIME_WAIT.

You can check this with "netstat" on Linux, not sure how on Solaris.

-1


source







All Articles