TipcSrvConnMsgSearchType search the message queue of a connection for a message with a specific type
srv
connection handle to RTserver
timeout
maximum number of seconds to wait for desired message to arrive
mt
desired message type
A message if successful, NULL
otherwise.
If TipcSrvConnMsgSearchType fails, it returns NULL
and sets the global SmartSockets error number to one of:
TipcSrvConnMsgSearchType is a convenience function that searches for a message with a specific type by calling TipcConnMsgSearchType. A connection has a priority queue of incoming messages. See TipcConnMsgSearchType for more information on searching a connection’s message queue.
TipcSrvConnMsgSearchType may attempt to automatically create a connection to RTserver. If RTclient has a warm connection to RTserver, and if any messages are in the warm connection message queue, TipcSrvConnMsgSearchType searches the messages in the warm connection. If no messages are queued in the warm connection, then TipcSrvConnMsgSearchType calls TutSleep with timeout, so that RTclient does not use an abnormal amount of CPU time. See TipcSrvConnOpen for more information on automatic creation of connections and warm connections to RTserver.
The message returned by TipcSrvConnMsgSearchType should be destroyed when it is no longer needed by calling TipcMsgDestroy, unless the message is passed to another function which takes responsibility for destroying the message (such as TipcSrvConnMsgInsert).
TipcConnMsgSearchType, TipcSrvConnMsgSearch
This example waits indefinitely for the next CONTROL message to arrive from the connection to RTserver:
mt = TipcMtLookupByNum(T_MT_CONTROL); if (mt == NULL) {return
; /* error */
} msg = TipcSrvConnMsgSearchType(srv, T_TIMEOUT_FOREVER, mt); if (msg == NULL) {return
; /* error */
}
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |