New class for connecting to socket.