TCP stream socket wrapper and server