ucspi-tcp is command-line tools for building TCP client-server applications. http://cr.yp.to/ucspi-tcp.html