Boost logo

Boost Users :

From: bringiton bringiton (kneeride_at_[hidden])
Date: 2007-05-22 01:11:31


Hi guys,

I'm wondering whether you know a solution to the following problem: I
wish to have a tcp connection that sends binary messages of dynamic
length.

I plan on using asio, but I am concerned with the following: say i
send 5 messages with lengths (10, 5, 30, 2, 3). As far as I
understand TCP, when I read the stream on the other end, I will not
receive the data 1 message at a time. Instead I will receive a stream
that may hold N messages and may even hold portions of a message. eg
the stream may hold 13 bytes, which is the first message and 3 bites
of the 2nd.

Are there any solutions to this? ie building messages as they come in
through the TCP stream.

I know how to implement this myself however I assume that this is
probably a common problem.

Thanks.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net