waiting for the connection
registration timeout is optional