The client group to which the
BrokerClient belongs may limit the event types the
Broker client may publish. See
Client Groups for more information. The following example contains an excerpt from the
publish1.c sample application that shows the use of the
awCanPublish function to check for event publication permission. The function requires these parameters:
. . .
BrokerClient c;
BrokerBoolean can_publish;
. . .
err = awCanPublish(c, "Sample::SimpleEvent", &can_publish);
if (err != AW_NO_ERROR) {
printf("Error on check for can publish\n%s\n", awErrorToString(err));
return 0;
}
if (can_subscribe == 0) {
printf("Cannot publish event Sample::SimpleEvent.\n");
printf("Make sure it is loaded in the broker and \n");
printf("permission is given to publish it in the \n");
printf("%s client group.\n", client_group);
return 0;
}
. . .
You can also use the
awGetCanPublishNames method to obtain the names of all the event types which a
Broker client can publish.