On Thu, May 7, 2009 at 11:12 PM, Peter Ross <pe...@emailross.com> wrote:
> I'm new to libevent and I've been reading the tutorial at
> http://wangafu.net/~nickm/libevent-book/01_intro.html and am playing
> with the bufferevent version of the rot13 server at the very end of
> this web page compiled against 2.0.1-alpha.
>
> What I would like to do it add some code which is run when the client
> connecting to the rot13 server closes it's connection.
>
> It's not clear to me how one would do this.  Could someone elaborate
> on how one would detect this?
>
After examining the source bufferevent_sock.c I think I can answer my
own question.

The error cb is called with the what argument equal to EVBUFFER_READ |
EVBUFFER_EOF.

At this point you can add your code to handle what to do when the
client closes it's connection.
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to