question: private void waitForStateChange ( int maxTTW ) throws MqttException { synchronized ( waiter ) { if ( ! donext ) { try { waiter . wait ( maxTTW ) ; } catch ( InterruptedException e ) { log ( "timed out" ) ; e . printStackTrace ( ) ; } if ( ex != null ) { throw ( MqttException ) ex ; } } donext = false ; } }
target:  Wait for a maximum amount of time for a state change event to occur