Navigation:  Communication Libary > Class Library API > Real-Time Messaging (RTMP) >

RTMPClient

Previous pageReturn to chapter overviewNext page

connect:

Establishes an RTMP connection to the root application running on the specified RTMP server running on the default port (1935). Traditionally the server would be accessible via the URL formatted as: rtmp://server

-(void)connect:(NSString *)server;

Arguments

server

 The IP address or hostname of the server where the RTMP server is running

connect:port:

Establishes an RTMP connection to the root application running on the specified RTMP server on the specified port. Traditionally the server would be accessible via the URL formatted as: rtmp://server:port

-(void)connect:(NSString *)server port:(int)port;

Arguments

server

 The IP address or hostname of the server where the RTMP server is running

port  

 The port of the socket the server is listening on

 

connect:port:app:

Establishes an RTMP connection to the application on the specified RTMP server running on the given port. Traditionally the server would be accessible via the URL formatted as: rtmp://server:port/app

-(void)connect:(NSString *)server port:(int)port app:(NSString *)application;

Arguments

server

 The IP address or hostname of the server where the RTMP server is running

port  

 The port of the socket the server is listening on

app  

 The application name

 

connect:port:app:params:

Establishes an RTMP connection to the application on the specified RTMP server running on the given port with an array of connection parameters

-(void)connect:(NSString *)server port:(int)port app:(NSString *)application params:(NSArray *)params;

Arguments

 server

 The IP address or hostname of the server where the RTMP server is running

 port

 The port of the socket

 app

 The application name

 params

 The array of application parameters passed into the application's 'connect' method on the server

 

delegate

A property with a reference to an implementation of the IRTMPClientDelegate protocol. Provides access to the connection-related events as well as a handler for return values from the client-to-server calls and server-to-client invocation requests.

@property (nonatomic, assign) id <IRTMPClientDelegate> delegate;

 

invoke:withArgs:

Invokes a method with the array of arguments on the application the client is connected to.

-(void)invoke:(NSString *)method withArgs:(NSArray *)args;

Arguments

 method

 The method name

 args

 The array of the method arguments

 

getSharedObject:persistent:

Returns a reference to a remote shared object that multiple clients can access. If the remote shared object does not already exist, it is created by the server (if the application the client is connected to allows RSO construction).

-(id <IClientSharedObject>)getSharedObject:(NSString *)name persistent:(BOOL)persistent;

Arguments

 name

 The name of the shared object

 persistent

 If YES – specifies that the shared object is persistent on the server. The value of NO indicates the shared object is not persistent.