On Wed, Mar 31, 2010 at 11:53 AM, Anomit Ghosh wrote:
> I'm basically trying to a write a very simple echo server/client
> combination, just for trying out libevent. The server doesn't use
> libevent's bufferevent, but the client does.
>
> Code for server: http://codepad.org/nP0KsfPY
> Code for cl
On Wed, Mar 31, 2010 at 7:10 AM, Sebastian Sjöberg
wrote:
> On Mar 31, 2010, at 10:02 AM, Jarod Liu wrote:
>
>> Hi,
>> I writing a eventbuffer socket app. My app packet have a length
>> header, I want to read data only when input buffer length > packet
>> length(I need to read the length header fi
I'm basically trying to a write a very simple echo server/client
combination, just for trying out libevent. The server doesn't use
libevent's bufferevent, but the client does.
Code for server: http://codepad.org/nP0KsfPY
Code for client: http://codepad.org/XRJAVg5m
The problem seems to be that e
On Mar 31, 2010, at 10:02 AM, Jarod Liu wrote:
> Hi,
> I writing a eventbuffer socket app. My app packet have a length
> header, I want to read data only when input buffer length > packet
> length(I need to read the length header first). But it seems like I
> can't read from evbuffer without drain
can you read the length header (four bytes I guess?) and keep it
somewhere in your program, and then wait for enough data to be
readable?
Regards,
Shuo Chen
On 3/31/10, Jarod Liu wrote:
> Hi,
> I writing a eventbuffer socket app. My app packet have a length
> header, I want to read data only whe
Hi,
I writing a eventbuffer socket app. My app packet have a length
header, I want to read data only when input buffer length > packet
length(I need to read the length header first). But it seems like I
can't read from evbuffer without draining data. Is there a way to do
that?
*