Specifying Subscription IDs
The following example illustrates the use of the awNewSubscriptionWithId function to associate two subscription identifiers with two different subscriptions. The awNewSubscriptionWithId function accepts these parameters:
A
BrokerClient handle.
The subscription identifier.
An event type name.
An event filter or
NULL if event filtering is not desired. Filters are described in
Managing Event Types.
BrokerClient c;
. . .
/* Make a subscription #1*/
err = awNewSubscriptionWithId(c, 1, "Sample::SimpleEvent1", NULL);
if (err != AW_NO_ERROR) {
printf("Error on create subscription\n%s\n", awErrorToString(err));
return 0;
}
/* Make a subscription #2*/
err = awNewSubscriptionWithId(c, 2, "Sample::SimpleEvent2", NULL);
if (err != AW_NO_ERROR) {
printf("Error on create subscription\n%s\n", awErrorToString(err));
return 0;
}
. . .