On Tue, Nov 22, 2011 at 4:18 PM, <ivan.nov...@emc.com> wrote: > In order to detect a "disconnection" by the client i look for a return > value of 0 from read() in the callback function. > > This seems to work correctly when i do a kill -INT on the client or a kill > -9 on the client: the callback is triggered on the server and the return > from read() is 0. > > However if i a do hard reset(power off) of the machine running the client, > it does not seem to work and I believe I am not getting a callback > function for the event on the server.
This is normal and expected. TCP doesn't really have a good way to detect this. You can use SO_KEEPALIVE to ask the OS to do its own keepalives; then it'll probably detect dead connections within a couple hours. - Dan *********************************************************************** To unsubscribe, send an e-mail to majord...@freehaven.net with unsubscribe libevent-users in the body.