make sure socket.handshake exists