Both netcat and tcpserver listen on a socket. When a client connects, all data send by the client is directed to a file or device. Similarly, any data read from the device is sent back to the client. Sounds like basically what you need.
Originally Posted by lollobrigido
Netcat simply redirects the input to standard output. So to connect the socket to the device, you simply redirect netcat into the device:
In practice you would need to place the tty into the proper mode. You might do this with a smaller wrapper program, say, "initty":
nc -l 9919 > /dev/tty
Or something like it.
nc -l 9919 | initty /dev/tty
Netcat only supports one-way communication as far as I know. tcpserver may be more full-featured, but I have not used it.