adding support for tcp sockets
adding unit tests
making unit tests script fail on error