Boost logo

Boost :

From: Iain Hanson (Iain.Hanson_at_[hidden])
Date: 2005-04-25 11:04:43


On Mon, 2005-04-25 at 00:50 +0300, Peter Dimov wrote:
> Don G wrote:
> >> This doesn't make any of these streams networks,
> >> and neither is a communication port a network.
> >
> > I won't debate semantics here (too much<g>): Once the line is up,
> > communications between A and B occur in exactly the same way as they
> > would with TCP/IP. Both ends "listen" for incoming stream connections
> > on multiple ports (each for a different "service"), each can accept
> > one or more datagrams on different ports, again for different
> > services. In a nutshell, they are abstractly identical. The big
> > difference is that the entire network consists of two hosts.
>
> Yes, I see. I was thinking of a different scenario, however, one in which
> you communicate with a device over a serial line (not with another host)
> using a specified protocol. Since serial lines are relatively slow,
> asynchronous communication is a good thing.
>
> >> This of course leads to the obvious question:
> >> which network gives me a stream over COM1?
> >
> > network_ptr com1 =
> > new net_over_stream(
> > new stream_over_serial("com1"));
>
> Wait a minute. Which network creates the stream_over_serial? Assume that I
> don't need the outer network since I'll be communicating with a printer, for
> example.
>
> >> LPT1?
> >
> > network_ptr lpt1 =
> > new net_over_stream(
> > new stream_over_lpt("lpt1"));

This is wrong IMHO. These are devices. If you want to implement a
network over them then it should be done with device drivers. E.g you
could implement PPP over COMn and then access it via socket or net:: lib
via TCP or UDP.

/ikh




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