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

[Libevent-users] Delay in bufferevent_write



This is my first time using libevent and please forgive my ignorance.

I am trying a basic client server. The client sends a ping and the server replies back.
If I send one request and wait for the reply and send another request after the replay has been received, then my code seems to work fine.

But I send multiple request ( say start with 5 requests) and then my subsequent requests are delayed and eventually if in total I sent 25 requests only 18 reach the server.
It appears the if I send more than one request, it is getting buffered somewhere and only the subsequent write sends the buffered requests .
I tried with bufferevent_flush and also wait for write callback. but both these approaches do not work.
So the questions, if I have to make multiple calls bufferevent_write, should there be a delay? Do i need to set some watermarks to push the data out?

Thanks
Nivi