Connect to socket