Boost logo

Boost :

From: gtpaw (gtpaw_at_[hidden])
Date: 2002-02-25 15:58:27


When implementing an interprocess communication (IPC) mechanism, the
developer usually ends up with the same top-level design, no matter what is the underlying
communication engine (sockets, shared memory, pipes, etc.).
Hence, IMHO, the socket library's functionality should be restricted to the following
primitive operations: connect, listen, send, recv.

Naturally, If we get the details right, we can also implement a
corresponding pipe library, and a shared memory library.

At the next step, we can create an IPC library, which will use either
of the above-mentioned libraries. This library would support both blocking and non-blocking
I/O operations, thru an inserter/extractor interface:

typedef boost::ipc<boost::socket> my_ipc_t;
my_ipc_t my_ipc;
.
.
// writer1 uses a 1000 ms timeout period
my_ipc_t::writer_type writer1 = my_ipc.make_writer(1000);
writer1 << "Hello there\n";
.
.
// writer2 is blocking
my_ipc_t::writer_type writer2 = my_ipc.make_writer();
writer2 << "Hello again\n";

Comments are highly appreciated
-Itay


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk