socat HOWTO

######
Virtual serial port (pty->Digi)
######
// Create /dev/pty0 and connect it to a remote socket 
(a digi SP-1 terminal server)

sudo socat pty,link=/dev/pty0,user=ops,min=0,time=0,nonblock=1,clocal=0,ignoreeof tcp4:xfoce-sp1:2001

//  software opens /dev/pty0 and uses it like a serial port

######
Echo server (TCP loop back)
######
// fork a new udp for every incoming connection and echo 
// what comes in
socat -v PIPE udp-recvfrom:5553,fork

// create /dev/pty0 and connect it to an echo server client 
sudo socat pty,link=/dev/pty0,user=ops,min=0,time=0,nonbck=1,clocal=0,ignoreeof  udp:localhost:5553

// use /pty0 like a serial port - everything sent is echoed