move tcp listener / server stuff to socket.lua