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

Graham Leggett minfrin at
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:

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

-------------- 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: <>

More information about the libev mailing list