StreamLink for iOS  8.0.0.233163-35883203
Publishing Field value pairs

Classes

protocol  <SLCommandListener >
 Defines that protocol that should be implemented by the application to receive results of commands (for example Publishing data) that are executed on the Liberator. More...
 
protocol  <SLCommandResultEvent >
 Provides information about the result of a command. More...
 
protocol  <SLCommandSubscription >
 Represents a persistent command. More...
 
class  SLPair
 Defines a pair type that is used to pass a field and value to StreamLink. More...
 

Enumerations

enum  SL_CommandResult {
  SL_COMMAND_OK = 0, SL_COMMAND_NOTFOUND, SL_COMMAND_UNAVAILABLE, SL_COMMAND_DELETED,
  SL_COMMAND_READ_DENIED, SL_COMMAND_WRITE_DENIED, SL_COMMAND_INVALID_PARAMETERS, SL_COMMAND_ERROR_CANCELLED
}
 Enumeration defining the result of a command. More...
 

Detailed Description

The following example publishes data to subject /DEMO/MSFT:

#import <StreamLink/StreamLink.h>
@interface ExamplePublish : NSObject<SLCommandListener> {
}
@end
@implementation ExamplePublish
-(void)publish {
// Create a streamlink instance that connects to the server "myliberator" with password credentials
id<SLStreamLink> streamLink = [SLStreamLinkFactory createStreamLinkWithConfiguration:@"https://myliberator" username:@"admin" password:@"admin"];
// Connect to the server
[streamLink connect];
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
[dict setObject:@"2" forKey:@"Bid"];
[dict setObject:@"3" forKey:@"Ask"];
[streamLink publishToSubject:@"/DEMO/MSFT" fieldValues:dict commandListener:self];
}
// implementation of SLCommandListener
-(void) commandOkForSubject:(NSString *)subject withEvent:(id<SLCommandResultEvent>)commandEvent
{
NSLog(@"commandOkForSubject: subject=[%@], commandEvent=[%@]", subject, commandEvent);
}
-(void) commandFailedForSubject:(NSString *)subject withEvent:(id<SLCommandResultEvent>)commandEvent
{
NSLog(@"commandFailedForSubject: subject=[%@], commandEvent=[%@]", subject, commandEvent);
}
@end

Enumeration Type Documentation

Enumeration defining the result of a command.

Enumerator
SL_COMMAND_OK 

No error.

SL_COMMAND_NOTFOUND 

The subject could not be found.

SL_COMMAND_UNAVAILABLE 

The subject was not available.

SL_COMMAND_DELETED 

The subject has been deleted.

SL_COMMAND_READ_DENIED 

The client does not have permission to read the subject.

SL_COMMAND_WRITE_DENIED 

The client does not have permission to write to the subject.

SL_COMMAND_INVALID_PARAMETERS 

The supplied container parameters are invalid

SL_COMMAND_ERROR_CANCELLED 

The command has been cancelled due to a reconnection.


Generated on Tue Apr 23 2024 11:14:02 for StreamLink for iOS