TipcSrvQueueCbCreate create a queue callback in the connection to RTserver
mt
message type to create callback for (null means global callback)
func
callback function
arg
user-defined argument to pass to func
New callback if successful, NULL
otherwise.
If TipcSrvQueueCbCreate fails, it returns NULL
and sets the global SmartSockets error number to one of:
TipcSrvQueueCbCreate creates a queue callback in the connection to RTserver by calling TipcConnQueueCbCreate. These callbacks are called when a message is inserted into or deleted from the message queue of the connection to RTserver. See TipcConnQueueCbCreate for more information on queue callbacks.
TipcSrvQueueCbCreate may attempt to automatically create a connection to RTserver. If RTclient has a warm connection to RTserver, TipcSrvQueueCbCreate creates a queue callback in the warm connection. See TipcSrvCreate on automatic creation of connections and warm connections to RTserver.
The T_ENTRY declaration specifier is required in the definition of all callback functions as well as their prototypes.
TipcConnQueueCbCreate, TipcSrvQueueCbLookup
This example creates a global queue callback in the connection to RTserver which prints the number of queued messages:
void T_ENTRY my_srv_queue_cb(conn, data, arg) T_IPC_CONN conn;/* connection to RTserver */
T_IPC_CONN_QUEUE_CB_DATA data; T_CB_ARG arg;/* not used */
{ T_INT4 num_queued; if (!TipcSrvGetNumQueued(&num_queued)) {return
; /* error */
}/* print the queue size */
TutOut("Number of queued messages from RTserver is now %d.\n", num_queued); }/* my_srv_queue_cb */
/* =========================================================== */
/*...code from main program is below */
if (TipcSrvQueueCbCreate(NULL,/* NULL signifies global */
my_srv_queue_cb, NULL) == NULL) {return
; /* error */
}
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |