Boost logo

Boost :

From: davlet_panech (davlet_panech_at_[hidden])
Date: 2002-02-25 16:28:34


--- In boost_at_y..., "gtpaw" <gtpaw_at_w...> wrote:
> 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.

Yes, but what about connectionless protocols, like UDP? (accept() and
listen() are meaningless for these). Do we want to support them?
Obviusly limiting the socket library to TCP only will simplify
everything. Another issue is that availability of protocols can
frequently be determined at runtime only (although TCP is probably
always supported). Yesterday I was playing around with my own socket
library that supports UDP, only to discover that UDP isn't installed
on my machine (NT4.0). That makes me wonder if compile-time protocol
binding is a good idea.

>
> 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);

Doesn't this imply that a writer is copyable? I don't think it's a
good idea.

> writer1 << "Hello there\n";
> .
> .
> // writer2 is blocking
> my_ipc_t::writer_type writer2 = my_ipc.make_writer();
> writer2 << "Hello again\n";
>

It's also unclear what socket streams would look like. How do the two
connected sockets coordinate byte ordering, locales, etc.?

D.P.

>
> 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