Should I use EV_WRITE event?

钱晓明 mailtoantares at
Mon Nov 7 04:23:57 CET 2011

Hi, I am working on libev few days, and there is a question about EV_WRITE:
When processed request from client, the server has some data to write back. At this time, it can:
A. write back directly in a loop, until all data has been written
B. install a EV_WRITE event when client connected, check buffer in the callback function, and write back if there is data. The EV_WRITE event only install once.
C.install/start a EV_WRITE event when adding reply data to buffer, and in callback function write all data to client, stop EV_WRITE event at last before returning from this function.
Which one is best? How frequent the callback function will be called in situation B?
Thanks in advance!
Kyle Qian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the libev mailing list