Check this repo:

https://github.com/litesync/libuv_message_framing

Bernardo Ramos


On Sunday, May 24, 2015 at 7:50:54 AM UTC-3, Burak Tamtürk wrote:
>
> Hello,
>
> I am very sorry for disturbing people at here, however based on my 
> research i cant find a good way to parse the following packet with libuv.
>
> I am porting a tcp server to libuv based one (C based program). However 
> the data i want to read from the client is prefixed with static data and 
> the length. 
>
> 0x11 0x22 0x0 0x0 (size of packet) PACKET DATA 0x22 0x11
>
> I want my read callback to be executed after 4 bytes have been readed from 
> client.
>
> Then, i know the size of rest of the packet till new one, i want my 
> callback executed when the size of packet + 2 (tail) bytes have been readed 
> from the client. Then same steps again. (4 byte)
>
> OR is there any recommended way to do this in libuv? 
>
> Thanks,
> Burak
>

-- 
You received this message because you are subscribed to the Google Groups 
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.

Reply via email to