UNIX IPC Datagram Reliability under 4.2BSD
eric%cit-vax at sri-unix.UUCP
eric%cit-vax at sri-unix.UUCP
Sat Feb 4 14:24:38 AEST 1984
From: Eric Holstege <eric at cit-vax>
It is pointless to require reliable datagrams; the whole point of
datagrams is that they need not be reliable. If you want a reliable
channel, use a stream; you can simulate datagrams on a stream.
It would be convenient to be able to reliably send one message without going
through the trouble (and overhead) of setting up a stream.
In order to reliably send a datagram, one must have some indication that
the recipient is listening, as well as that he actually receives what he
is sent. This is tantamount to establishing a two-way connection, the
main inconvenience of streams relative to datagrams. Streams are more
general than datagram connections for the same reason that UNIX
byte-seekable files are more general than the record-seekable file types
beloved of VMS, etc. As for streams having more overhead, so do
byte-seekable files, but no one proposes that another file type,
512-byte-record files, be added to UNIX for the sake of efficiency. The
issue is the same, should the kernel give you the amount of data you
want to read, or should you be forced to read the amount it feels like
giving you.
Besides, pipes in 4.2 are implemented as IPC streams, with (if you
believe the performance figures) a substantial improvement over 4.1
pipes. Fast enough for me.
What I'd like to see is a library implementing something like VMS
mailboxes using sockets, with calling sequences that aren't as painful
to figure out as the socket stuff.
- Eric Holstege
eric at cit-vax
More information about the Comp.unix.wizards
mailing list