13 Jun 2012 16:39
How to limit the read/write( input/output ) traffic?
zhengfish <zhengfish <at> gmail.com>
2012-06-13 14:39:01 GMT
2012-06-13 14:39:01 GMT
Hi, all
I want to shape the read/write traffic, I check the data-structure
I find there are 4 members in the struct bufferevent which maybe do that function.
However I don't know how to do it in detail steps.
Anyone can share some tips for that?
struct bufferevent {
......
/** An input buffer. Only the bufferevent is allowed to add data to
this buffer, though the user is allowed to drain it. */
struct evbuffer *input;
/** An input buffer. Only the bufferevent is allowed to drain data
from this buffer, though the user is allowed to add it. */
struct evbuffer *output;
struct event_watermark wm_read;
struct event_watermark wm_write;
};
--
_ __ _ _
___| |__ ___ _ __ __ _ / _(_)___| |__
|_ / '_ \ / _ \ '_ \ / _` | | |_| / __| '_ \
/ /| | | | __/ | | | (_| | | _| \__ \ | | |
/___|_| |_|\___|_| |_|\__, | |_| |_|___/_| |_|
|___/
RSS Feed