TipcSrvConnSubjectGetSubscribe


Name

TipcSrvConnSubjectGetSubscribe — determine if an RTclient is subscribing to a subject

Synopsis

T_BOOL TipcSrvConnSubjectGetSubscribe(srv, subject, subscribe_status_return) 
T_IPC_SRV srv; 
T_STR subject; 
T_BOOL *subscribe_status_return; 

Arguments

srv — connection handle to RTserver

subject — name of the subject to get subscribe status for

subscribe_status_return — storage for subscribe status

Return Values

TRUE if the subscribe status of the subject was successfully retrieved, FALSE otherwise.

Diagnostics

If TipcSrvConnSubjectGetSubscribe fails, it returns FALSE and sets the global SmartSockets error number to one of:

Description

TipcSrvConnSubjectGetSubscribe determines whether an RTclient is subscribing to a subject. The subscribe status controls whether the RTclient receives messages published (sent) to that subject. If the subscribe status of subject is TRUE, the RTclient receives messages with subject as their destination that are sent to RTserver. To start or stop subscribing to a subject, use TipcSrvConnSubjectSetSubscribe. To find out if an RTclient is subscribing to a subject, including load balancing information, use TipcSrvConnSubjectGetSubscribeLb.

TipcSrvConnSubjectGetSubscribe may attempt to automatically create a connection to RTserver. TipcSrvConnSubjectGetSubscribe gets the subscribe status of the subject for both full and warm RTclient connections. See TipcSrvConnOpen for more information on automatic creation of connections and warm connections to RTserver.

Caution

If TipcSrvConnSubjectGetSubscribe returns FALSE, it does not store a value in subscribe_status_return.

See Also

TipcMonClientSubscribeSetWatch, TipcMonSubjectSubscribeSetWatch, TipcSrvConnSubjectSetSubscribe, TipcSrvConnSubjectGetSubscribeLb

Examples

This example gets the subscribe status of the subject /system/thermal:

T_BOOL subscribe_status; 
if (!TipcSrvConnSubjectGetSubscribe(srv, "/system/thermal", 
                                    &subscribe_status)) { 
  return;  /* error */ 
}  
TutOut("This process is %s the /system/thermal subject.\n", 
       subscribe_status ? "subscribing to" : "not subscribing to"); 

TIBCO SmartSockets™ Application Programming Interface
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com