utility for sending/receiving data over TCP stream
