Jeff Pang wrote:
The question I want to know is,when the 'close()' call happened,if it should generate a 'FIN' and send it to another end?If it's true,then at the server end,when it receive the 'EOF' coming from client,it can delay for some time to call 'close()',so the 'FIN' should not be sent to client immediately,is it?

Once you call close(), you're done with the connection. The kernel handles the various packets associated with terminating the connection.

When the server sees EOF, it can call close() immediately if it doesn't need to send any more data. Again, the kernel will handle the details.

shutdown() is only needed if you want to tell the other side you're done sending, but you need to be able to keep receiving data.

If you're interested in learning more, I *very highly* recommend you buy and read Stevens' "Unix Network Programming, Volume 1" (http://www.amazon.com/gp/product/0131411551).

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to