[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] async writes for bufferevent_write/bufferevent_write_buffer?
I have a server that sometimes speaks to very slow clients. As such, when I have data I want to write to the client, I'm accustomed to writing the data asynchronously. Before buffer events, I handled this by queueing up a 'write' event on the client's fd. When my callback was called, signifying I could write, I would write a portion of my data, then queue up another write. Wash-rinse-repeat until I'd written all the data I needed to. The async behavior is important as it allows me to do other work even if I have to write a large amount of data to a slow client.
Using buffer events, it seems that when I 'bufferevent_write' the write happens synchronously. I've registered a writecb for the bufferevent, but the writecb gets called after data's been written -- even deferring the callback doesn't change /when/ the data gets written, simply when the writecb is called (this deferral behavior matches what the documentation says).
So, when using bufferevent_write/write_buffer, is there a way to enforce asynchronicity?
thanks!
- scott***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.