Add query to handshake sent

Add method to set the query to be sent during handshake.
It should be set before calling init().