TipcSrvConnSubjectSetSubscribeLb start or stop subscribing to a subject, with or without load balancing
T_BOOL TipcSrvConnSubjectSetSubscribeLb(srv
,subject
,subscribe_status
,lb_status
) T_IPC_SRVsrv
; T_STRsubject
; T_BOOLsubscribe_status
; T_BOOLlb_status
;
srv
connection handle to RTserver
subject
name of the subject to set subscribe status for
subscribe_status
subscribe status
lb_status
load balancing status
TRUE
if the subscribe status of the subject was successfully set, FALSE
otherwise.
If TipcSrvConnSubjectSetSubscribeLb fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TipcSrvConnSubjectGetSubscribeLb and TipcSrvConnSubjectSetSubscribeLb are variants of TipcSrvConnSubjectGetSubscribe and TipcSrvConnSubjectSetSubscribe that include load balancing control.
TipcSrvConnSubjectSetSubscribeLb sets whether or not this RTclient is subscribing to a subject, with or without load balancing. The subscribe status controls whether or not the RTclient receives messages published (sent) to that subject. If the subscribe status of subject
is TRUE
, then the RTclient receives messages with subject
as their destination that are sent to RTserver. To determine if an RTclient is subscribing to a subject, including load balancing information, use TipcSrvConnSubjectGetSubscribeLb. If the load balancing status of subject is TRUE
, then the RTclient is part of the load balancing calculation; otherwise the RTclient overrides load balancing and always receives the messages regardless of whether or not the message was published with load balancing.
TipcSrvConnSubjectSetSubscribeLb may attempt to automatically create a connection to RTserver. If RTclient has a warm connection to RTserver, TipcSrvConnSubjectSetSubscribeLb sets the subscribe status of the subject as if the RTclient were still connected to RTserver. See TipcSrvConnOpen for more information on automatic creation of connections and warm connections to RTserver.
TipcSrvConnSubjectSetSubscribeLb sends a SUBJECT_SET_SUBSCRIBE message to RTserver, but does not explicitly flush the message. See TipcSrvConnGetAutoFlushSize for more information on message buffering.
TipcMonClientSubscribeSetWatch, TipcMonSubjectSubscribeSetWatch, TipcSrvConnSubjectGetSubscribeLb, TipcSrvConnSubjectSetSubscribe
This example uses TipcSrvConnSubjectSetSubscribeLb to start subscribing to the subject /system/thermal
and override load balancing so that this RTclient receives all messages published to the thermal
subject regardless of whether or not they were published with load balancing:
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |