D. J. Bernstein
TCP/IP
ucspi-tcp

The tcpclient program

tcpclient creates an outgoing TCP connection.

Interface

     tcpclient opts host port prog
opts is a series of getopt-style options. host is one argument. port is one argument. prog consists of one or more arguments.

tcpclient attempts to connect to a TCP server. If it is successful, it runs prog, with descriptor 6 reading from the network and descriptor 7 writing to the network. It also sets up several environment variables.

The server's address is given by host and port. port may be a name from /etc/services or a number. host may be 0, referring to the local machine, or a dotted-decimal IP address, or a host name; it is fed through qualification using dns_ip4_qualify.

If the server has several IP addresses, tcpclient tries each address in turn.

Options

General options: Connection options: Data-gathering options: