Simple TCP server/client and utility wrapper routines