Tcp socket setup

Basic setup for tcp sockets. In the future this should be refactored