[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Handling the connection close



On Sun, Mar 20, 2016 at 10:54:41AM -0400, Michael wrote:
> Hi all,
> 
> I want to ask what should I do when the connection is closed while I am
> sending or recving data. For example the connection is closed by the server
> explicitly or because the server is down, when the client is still sending
> data or recving data. For libevent, if the connection is closed, event
> callback is invoked. But in this callback what should we do? Is there any
> common practice?

That depends on your needs, you can take a look at http server for
example:
$ grep EOF libevent/http.c
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.