[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [Libevent-users] Closing bufferevents sockets from the server side
On 2010-11-24 15:54, Sid wrote:
> Well water marks seem to be the way to go.. But before your reply came I
> saw that in the library there is an interface
>
> *struct* evbuffer_cb_info {
> size_t orig_size;
> size_t n_added;
> size_t n_deleted;
> };
>
> *typedef* *void* (*evbuffer_cb_func)(*struct* evbuffer *buffer,
> *const* *struct* evbuffer_cb_info *info, *void* *arg);
>
> described http://www.wangafu.net/~nickm/libevent-book/Ref7_evbuffer.html
>
>
> I think this is the right way to do this stuff...
It is most definitely the *wrong* way.
Free the bufferevent in write callback with a write watermark set to 0.
That is the right way to do it.
Simon
--
DTN made easy, lean, and smart --> http://postellation.viagenie.ca
NAT64/DNS64 open-source --> http://ecdysis.viagenie.ca
STUN/TURN server --> http://numb.viagenie.ca
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.