|
NAMEsocket - create tcp socket and connect to stdin/outSYNOPSISsocket [ -bcfqrvw ] [ -p command ] host portsocket [ -bcfqrvw ] [ -p command ] -s [ -l ] port DESCRIPTIONSocket creates an Internet domain TCP socket and connects it to stdin and stdout. The host argument can be an Internet number in dot-notation (like ``130.149.28.10'') or a domain name. In this case it must be possible to resolve the name to a valid Internet address with gethostbyname(3). The port argument can be a port number or a service name which can be mapped to a port number by getservbyname(3).OPTIONS
EXAMPLESThe command
connects to the nntp port (port 119) of coma.cs.tu-berlin.de
(130.149.28.10).
creates a server socket on port 3425 on the local host and waits
for a connection. After a connection has been closed, a new connection is
accepted.
creates a server socket on port 1938 on the local host and waits for a connection. When a connection is accepted, the string "Socket!" is written to the socket. No data is read from the socket and written to the finger program. The connection is closed when an end-of-file condition at the standard output of the program occurs. Then a new connection is accepted. DIAGNOSTICSLots of diagnostics for failed system calls.
A non-zero exit code is returned if socket terminates due to an error condition or a signal. SEE ALSOaccept(2), bind(2), connect(2), socket(2), gethostbyname(3), getservbyname(3)BUGSsocket -p terminates due to a SIGPIPE signal when there is more data from the socket available than the executed program wants to read.Please report any other bugs to the author. VERSIONThis manual page describes Socket-1.1.AUTHORJuergen Nickelsen <jn@berlin.snafu.de>
Visit the GSP FreeBSD Man Page Interface. |