Navigation:  Communication Libary >

Server Data Push

Previous pageReturn to chapter overviewNext page

RTMP servers provide the API for calling client-side functions, thus effectively executing data push since the client is connected to the server via a persistent connection. The library delivers server-to-client invocation requests via the IPendingServiceCallback protocol.The protocol is inherited by IRTMPClientDelegate. An implementation of that protocol must  be assigned to the delegate property on the RTMPClient instance. Consider an implementation of the resultReceived method below:

-(void)resultReceived:(id <IServiceCall>)call {
   NSString *method = [call getServiceMethodName];
   NSArray *args = [call getArguments];
   int status = [call getStatus];  
   if (status != 0x02) // this call is not a server to client call
   NSLog(@" received invocation request from server <---- status=%d, method='%@', arguments=%d\n", status, method, args.count);  

For additional information see the API documentation for the IPendingServiceCallback and IServiceCall protocols.