You would need to implement a ZeroCopyInpuStream around the socket. The
implementation's Next() method would basically wrap the socket's read_some
method, and yield the buffer and size of data that was read. Since Next()
should return false when there's no more data to read, you would just check
for eof.

On Sun, Apr 15, 2012 at 4:56 AM, Ebu <[email protected]> wrote:

> I have a client that sends a PB serialized message to a server which
> is implemented with C++, using boost/asio-library's sockets. No matter
> how hard I try to figure it out or google about it, I can't find a
> simple example on how to actually read the data from (asio)socket so
> that I can parse it back to a PB-message.
>
> Are there any simple examples on how one reconstructs a PB defined
> message from data received from a socket after accepting the
> connection with boost::asio::tcp::socket::accept()?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to