Boost logo

Boost Users :

Subject: [Boost-users] asio guidance
From: Paul Dugas (paul_at_[hidden])
Date: 2010-02-27 22:32:42


I'm writing code to implement an existing communication protocol that
uses a packet with a fixed header and variable payload (depending on a
header field).  I started using a previously recorded file and
fstream::read() calls; i.e. read(buf,1) looking for the
start-of-packet, read(buf, HEADER_LEN), extract the payload size and
read the remainder. I am now looking to hook up the receiver logic to
the actual gear and need to handle timeouts and such.

I'm new to asio but it looks like what I may need given that I have to
support device connections via serial ports and sockets but I also
need to retain the ability to read from files.  I'm wondering if
anyone could suggest an approach to support all three comm schemes
with the same packet reception logic. The idea would be for the
receive routine to return message pointers or throw on timeouts or
partial packets

Paul


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