protected void handlePendingCallResult ( RTMPConnection conn , Invoke invoke ) { final IServiceCall call = invoke . getCall ( ) ; final IPendingServiceCall pendingCall = conn . retrievePendingCall ( invoke . getTransactionId ( ) ) ; if ( pendingCall != null ) { // The client sent a response to a previously made call. Object [ ] args = call . getArguments ( ) ; if ( args != null && args . length > 0 ) { // TODO: can a client return multiple results? pendingCall . setResult ( args [ 0 ] ) ; } Set < IPendingServiceCallback > callbacks = pendingCall . getCallbacks ( ) ; if ( ! callbacks . isEmpty ( ) ) { HashSet < IPendingServiceCallback > tmp = new HashSet <> ( ) ; tmp . addAll ( callbacks ) ; for ( IPendingServiceCallback callback : tmp ) { try { callback . resultReceived ( pendingCall ) ; } catch ( Exception e ) { log . error ( "Error while executing callback {}" , callback , e ) ; } } } } }
Handler for pending call result . Dispatches results to all pending call handlers .