tcpserver — listen for incoming TCP connections and spawn a child per conection
tcpserver
[-O] [-P] [-q] [-Q] [-R] [-H] [-d] [-b backlog
] [-v] [-D] [-o] [-l localname
] [-c connlimit
] [-U] [-B banner
] {host
} {port
} {next-prog
}
tcpserver is a utility that opens a TCP socket bound to host
and port
, and loops forever, accepting TCP connections and (for each such connection) spawning next-prog
, closing the listening socket in the child process and setting the connected socket as the child process' standard input and standard output.
It devolves to a combination of tcp-socket-listen(1), tcp-socket-accept(1), line-banner(1), and setuidgid_fromenv(1).
next-prog
may contain its own command line options, which tcpserver will ignore.
The -O , -P , -q , -Q , -H , -R , and -d command-line options simply would enact what are already the defaults, are thus present solely for compatibility, and are thus ignored.
The -b command-line option is passed through to tcp-socket-listen, with any of its option arguments.
The -v , -D , -o -l , and -c options are passed through to tcp-socket-accept, with any of their option arguments.
The -U command-line option causes setuidgid-fromenv to be invoked.
The -B banner
command-line option causes line-banner to be invoked, with banner
as the banner.