Calling close() on a non blocking socket from within an io watcher

Graham Leggett minfrin at sharp.fm
Sat Aug 8 17:54:25 CEST 2009


Marc Lehmann wrote:

> Except that close does not cause data loss on a unix or windows system,
> no matter how often you repeat this untrue statement.

Lots of people disagree:

http://blog.netherlabs.nl/articles/2009/01/18/the-ultimate-so_linger-page-or-why-is-my-tcp-not-reliable
http://lists.freebsd.org/pipermail/freebsd-questions/2004-June/049093.html
http://www.developerweb.net/forum/archive/index.php/t-2982.html

Feel free to Google further to see how confusing this issue is.

>> Existing protocols like HTTP don't wait for an ack, how do they do it?
> 
> They do send an ack some way or another - HTTP/1.1 for example tells you
> how long the request or response is before sending it (or parts of it).

I'm not talking about the client reading from the server, I am talking
about the server sending to the client.

The client does not send an ack back to the server saying "I got it",
that just isn't how HTTP works.

The server sends the last chunk, and if keepalives are not in effect,
closes the connection. There is no ack received from the client by the
server to say "ack".

What I am interested in knowing is how to achieve this in a non blocking
fashion.

Regards,
Graham
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3287 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.schmorp.de/pipermail/libev/attachments/20090808/5170e89d/attachment.bin>


More information about the libev mailing list