TCP library
Richard A. O'Keefe
ok@atlas.otago.ac.nz
Thu, 4 Feb 1999 11:33:52 +1300 (NZDT)
From: Martin Wierich[SMTP:martinw@cs.kun.nl]
Sent: Wednesday, January 27, 1999 11:25 AM
In about two month, the Object IO library will contain a TCP interface.
It will contain a synchronous and an asynchronous part.
Before you release anything, I'd ask you to look at the Unicon socket
interface. Briefly:
open(addr, "na") Listen on a TCP socket (as a server)
open(addr, "n") Connect to a TCP socket (as a client)
open(addr, "nau") Listen on a UDP socket (as a server)
open(addr, "nu") Connect to a UDP socket (as a client)
where addr is
host.name:port port @ remote host
:port port @ local host
file/name UNIX domain socket, TCP only
open() is also used for opening ordinary files and devices;
with the "n" mode it returns streams that can be treated like other
non-seekable streams and are closed with the same close() as other stream.
There are also send() and receive() procedures for sending and receiving
datagrams.
gethost(host) returns an alias/address record for the specified host;
gethost() is effectively a stream of aliases/addresses records.
getserv(service, protocol) returns a name/aliases/port/protocol
record for that service; getserv() is effectively a stream of these
records.
I bring this up because the Unicon interface
- has already had a *lot* of discussion and design
- is remarkably straightforward to use
- has been or is in the process of being ported to Windows;
as far as I know the only thing that gave trouble is fork(),
which the TCP interface doesn't depend on.
See
http://www.drones.com/unicon/