Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Apr 1996 22:29:17 -0400
From:      "Louis A. Mamakos" <louie@TransSys.COM>
To:        "Karl Denninger, MCSNet" <karl@mcs.com>
Cc:        hackers@freebsd.org
Subject:   Re: Silly socket question 
Message-ID:  <199604170229.WAA12073@whizzo.transsys.com>
In-Reply-To: Your message of "Tue, 16 Apr 1996 12:33:34 CDT." <m0u9EdD-000IDOC@venus.mcs.com> 
References:  <m0u9EdD-000IDOC@venus.mcs.com> 

next in thread | previous in thread | raw e-mail | index | archive | help

> Is there some option that can be passed to the stack to tell the system that
> I don't *care* about any buffered metadata and that it needs to release the
> socket resources *right now*?  The parent process which accepted these
> connections (but closed them) is still around, but the child (which 
> inherited them) is long gone.

It sure smells like there is still an open fd associated with the
connection.

After you fork/exec the child process, the parent process should close
the fd it accepted the connection on.  A TCP connection in CLOSE_WAIT
state means that it has recieved a FIN from the remote TCP (that is,
the remote TCP did a close or shutdown, indicating it has no more data
to send).  The local TCP is in a state such that it can continue to
send data to the remote host.  This should only be the case if there's
an open fd for the socket still around.

Doing a close() on the fd in the parent will remove the last reference
to the socket, and cause it to move from CLOSE_WAIT state to LAST_ACK
and and finally CLOSED.  It's likely that the remote TCP is sitting in
FIN_WAIT_2 state since you've never sent it a FIN by closing the local
socket.

louie




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199604170229.WAA12073>