TipcSrvConnQueueCbCreate create a queue callback in the connection
T_CB TipcSrvConnQueueCbCreate(srv
,mt
,func
,arg
) T_IPC_SRVsrv
; T_IPC_MTmt
; T_IPC_CONN_QUEUE_CB_FUNCfunc
; T_CB_ARGarg
;
srv
connection handle 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 TipcSrvConnQueueCbCreate fails, it returns NULL
and sets the global SmartSockets error number to one of:
TipcSrvConnQueueCbCreate 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.
TipcSrvConnQueueCbCreate may attempt to automatically create a connection to RTserver. If RTclient has a warm connection to RTserver, TipcSrvConnQueueCbCreate creates a queue callback in the warm connection. See TipcSrvConnOpen for more information 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, TipcSrvConnQueueCbLookup
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; { T_INT4 num_queued; T_IPC_SRV srv = arg; if (!TipcSrvConnGetNumQueued(srv, &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 (TipcSrvConnQueueCbCreate(srv, NULL,/* NULL signifies global */
my_srv_queue_cb, srv) == NULL) {return
; /* error */
}
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |