Hi all,
We are using libevent (libevent 2.0.22-1) for our lightweight RPC library[1] on top of libevent.
The RPC implementation is length-encoded, i.e the first 8 bytes of the message
contains the length of the message. We use filtered bufferevents to wait until
an entire message is 'pulled-up' into the input buffer before the read callback
is called. While doing the above we face the following issue,
The test client code[2] performs 'N' bufferevent_write() calls before calling
event_base_dispatch(). With instrumentation, I observed that test server[3]
receives 'N' calls to read filter callback, each returning BEV_OK but the read
call back registered on the accepted connection was called only once. Am I
missing something? Could someone point me how to debug this further?
[1] -
https://github.com/krisis/pbrpc[2] -
https://github.com/krisis/pbrpc/blob/pbrpc-C-API/tests/client.c[3] -
https://github.com/krisis/pbrpc/blob/pbrpc-C-API/tests/server.c