TipcSrvConnSubjectTraverseSubscribe


Name

TipcSrvConnSubjectTraverseSubscribe — traverse the subjects that the RTclient is subscribing to

Synopsis

T_PTR TipcSrvConnSubjectTraverseSubscribe(srv, func, arg) 
T_IPC_SRV srv; 
T_IPC_SRV_SUBJECT_TRAV_FUNC func; 
T_PTR arg; 

Arguments

srv — connection handle to RTserver

func — function to call once for each subject

arg — user-defined argument to pass to func

Return Values

The first non-null return value from func, or NULL if func always returns NULL.

Diagnostics

If TipcSrvConnSubjectTraverseSubscribe fails or traverses all the subjects an RTclient is subscribing to, it returns NULL and sets the global SmartSockets error number to one of:

Description

TipcSrvConnSubjectTraverseSubscribe traverses all the subjects an RTclient is subscribing to (the subjects with a subscribe status of TRUE) and calls func once for each subject. If func returns a non-null value, then TipcSrvConnSubjectTraverseSubscribe returns with that value.

TipcSrvConnSubjectTraverseSubscribe may attempt to automatically create a connection to RTserver. If RTclient has a warm connection to RTserver, TipcSrvConnSubjectTraverseSubscribe traverses the subjects as if the RTclient were still connected to RTserver. See TipcSrvConnOpen for more information on automatic creation of connections and warm connections to RTserver.

Caution

If TipcSrvConnSubjectTraverseSubscribe returns NULL, it may be because there was an error or simply because func always returned NULL.

See Also

TipcMonClientSubscribePoll, TipcMonSubjectSubscribePoll; see the TIBCO SmartSockets Utilities for information on TutHashTraverse.

Examples

This example prints the names of all subjects being subscribed to:

/* =============================================================== */ 
/*..print_one_subject -- traverse one subject */ 
T_PTR print_one_subject(name, dummy, arg) 
T_STR name; 
T_STR dummy; /* not used */ 
T_PTR arg; 
{ 
  TutOut("This process is subscribing to subject <%s>.\n", name); 
 
  return NULL; /* continue traversal */ 
} /* print_one_subject */ 
 
/* =========================================================== */ 
/*...code from calling function is below */ 
 
(void)TipcSrvConnSubjectTraverseSubscribe(srv, print_one_subject, 
                                          NULL); 

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