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

Re: [Libevent-users] evbuffer - how to read without draining data?



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 <liuyuanzhi@xxxxxxxxx> 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 draining data. Is there a way to do
> that?
> ***********************************************************************
> To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
> unsubscribe libevent-users    in the body.
>
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.