Public Repository

Last pushed: a year ago
Short Description
A small TCP server that echoes back the messages it receives (for test purposes).
Full Description

A small TCP server that echoes back the messages it receives (for test purposes).

By default, it uses port 65123 but it can be changed with the -p option. If hostname is not specified, it defaults to what gethostname() returns.

Typical invocation would be:

[Terminal A]

$ docker run --rm -it -p 65123:65123 tcp_serv

[Terminal B]

$ nc localhost 65123

Command line options are:

Usage: tcp_serv [-AhnPqv] [-b bytes] [-p port] [hostname]

-A use SO_REUSEADDR

-b next arg is number of bytes to send back

-h print help message

-n prepend message number in reply

-P use SO_REUSEPORT

-p next arg is port number (default 65123)

-q quiet mode

-v verbose mode

Docker Pull Command
Owner
saied