0
votes

My server program creates tcp socket that listens on a specific port(assume that the port = p1).

Nowdays by using the command "netstat -apn" i find many tcp connections on port p1 hangs in the state "close_wait" and related sockets seem to belong to the init process(pid=1).

The tcp connections still out there even if my server process is killed.

I cannot figure out in what circumstances can this happen.

1

1 Answers

0
votes

If the parent ends, the children won't implictly die, but live on.

After the parent's dead a child gets inherited by the init process. The latter is defined to carry pid 1.