On Tue, Nov 23, 2010 at 10:53 PM, Ken Feng <kfmf...@gmail.com> wrote:
> Within libevent, of course. As a point of reference, let's say we > start up the TCP Echo server that is in Nick's book here: > http://www.wangafu.net/~nickm/libevent-book/Ref8_listener.html<http://www.wangafu.net/%7Enickm/libevent-book/Ref8_listener.html> > > I could handle a normal client shutdown by sending a special shutdown > sequence from client to server, but what about connection lost? What > is the best way for the server to detect this state? Can I do it > without pinging the client? > > Thanks in advance. > > - Ken > *********************************************************************** > To unsubscribe, send an e-mail to majord...@freehaven.net with > unsubscribe libevent-users in the body. > Are you using buffer events? If so, in your errorcb look for BEV_EVENT_EOF, BEV_EVENT_ERROR, and BEV_EVENT_TIMEOUT. Free the context pointer and call bufferevent_free().