TipcSrvSubjectTraverseSubscribe


Name

TipcSrvSubjectTraverseSubscribe — traverse the subjects that the RTclient is subscribing to

Synopsis

T_PTR TipcSrvSubjectTraverseSubscribe(func, arg) 
T_IPC_SRV_SUBJECT_TRAV_FUNC func; 
T_PTR arg; 

Arguments

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 TipcSrvSubjectTraverseSubscribe 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

TipcSrvSubjectTraverseSubscribe 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 TipcSrvSubjectTraverseSubscribe returns with that value.

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

Caution

If TipcSrvSubjectTraverseSubscribe 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)TipcSrvSubjectTraverseSubscribe(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