#import "HelloWorldPubExample.h"
@implementation HelloWorldPubExample
- (id)initWithExampleInterface:(ExampleInterface *)exampleInterface {
self = [super initWithExampleInterface:exampleInterface];
self.name = @"HelloWorldPub";
self.description = @"Demonstrates the basics of session creation, "
@"connection and publishing direct messages to a topic";
[self.parameters addParameter:PARAMETER_DESTINATION_TOPIC];
[self.parameters removeParameter:PARAMETER_PASSWORD];
[self.parameters removeParameter:PARAMETER_COMPRESSION];
[self.parameters removeParameter:PARAMETER_LOGGING_LEVEL];
return self;
}
messageReceiveCallbackWithSession:
userData:(void *)user_p {
}
eventInfo:
userData:(void *)user_p {
}
- (void)run {
[super run];
const char *sessionProps[20];
int propIndex = 0;
const char *text_p = "Hello world!";
&context_p, &contextFuncInfo,
sizeof(contextFuncInfo));
propIndex = 0;
sessionProps[propIndex++] =
[[self.parameters parameterWithId:PARAMETER_HOST].value
cStringUsingEncoding:NSASCIIStringEncoding];
sessionProps[propIndex++] =
[[self.parameters parameterWithId:PARAMETER_VPN].value
cStringUsingEncoding:NSASCIIStringEncoding];
sessionProps[propIndex++] =
[[self.parameters parameterWithId:PARAMETER_USERNAME].value
cStringUsingEncoding:NSASCIIStringEncoding];
sessionProps[propIndex] = NULL;
&sessionFuncInfo, sizeof(sessionFuncInfo));
[[self.parameters parameterWithId:PARAMETER_DESTINATION_TOPIC].value
cStringUsingEncoding:NSASCIIStringEncoding];
msg_p, text_p, (solClient_uint32_t)strlen((char *)text_p));
(char *)text_p,
[[self.parameters parameterWithId:PARAMETER_DESTINATION_TOPIC].value
cStringUsingEncoding:NSASCIIStringEncoding]);
[self cleanup];
}
@end