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

[Libevent-users] draining bufferevents internal buffer



Hi,

I wonder if there is a way to drain the internal buffer of a bufferevent? Actually I use a bufferevent to write data into a socket. But it can happen that the socket is not accepting data for a while, which obviously lets the bufferevents internal buffer grow. Now I'd like to set a maximum buffer size, so that I can ensure that even when the socket is blocked for a longer period the application won't eat up all available memory.
I tried to do a evbuffer_drain on the evbuffer returned by bufferevent_get_output(), but this simply seems to have no effect. The buffer size remains unchanged, no matter how many bytes I try to drain out.
Is there any way to achieve what I want to do with libevent?

-Julian***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.