socat is the swiss army knife that just about lets you forget everything's not a file:
$ socat readline: file:/dev/ttyS0,crnl,crtscts,echo=0 # interact with a serial port
$ socat readline: tcp:google.com:80 # interact with a tcp port
$ socat tcp-listen:1234,fork exec:cat # a forking cat service
socat is the swiss army knife that just about lets you forget everything's not a file:
$ socat readline: file:/dev/ttyS0,crnl,crtscts,echo=0 # interact with a serial port
$ socat readline: tcp:google.com:80 # interact with a tcp port
$ socat tcp-listen:1234,fork exec:cat # a forking cat service