> IIRC, close() never blocks. Unlike open(), connect(), and so on, there
> is on special handling for close() when O_NDELAY/O_NONBLOCK is set.
> Scary warnings in the close() man page aside, close() is probably the
> most benign of all I/O calls.
Since close is the last system call you normally use to access a socket, it
is the underlying network protocol implementation's last chance to tell you
if you have succeeded or failed. As a result, there are many circumstances
under which the 'close' system call will block until the underlying network
protocol can receive acknowledgements for all outstanding buffered data and
shutdown the underlying connection.
It is generally considered good practice to use the 'shutdown' system call
to shutdown the underlying network connection under program control. The
'close' system call should be used to deallocate the file descriptor.
DS
______________________________________________________________________
GNU Portable Threads (Pth) http://www.gnu.org/software/pth/
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager (Majordomo) [EMAIL PROTECTED]