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

[Libevent-users] Paired bufferevents can't let event_base_dispatch block?



I want use paired bufferevents to pass message to the thread whitch called event_base_dispatch.

...
struct bufferevent *pairbev[2];
bufferevent_pair_new(ebase, BEV_OPT_THREADSAFE, pairbev);
...
bufferevent_setcb(pairbev[1], Static_ReadCallback, NULL, Static_EventCallback, this);
bufferevent_enable(pairbev[1], EV_READ|EV_WRITE);
...

but I found that when the event_base has only pairbev[1] event on it, it can't let the event_base_dispatch block, this function return with value 1 Immediately.
I had tried both in linux and windows, it looks like the same. 
Does it a bug or was there something i Ignored?