TipcConnMsgSearchType search the message queue of a connection for a message with a specific message type
conn
connection to search
timeout
maximum number of seconds to wait for desired message to arrive
mt
desired message type
A message if successful, NULL
otherwise.
If TipcConnMsgSearchType fails, it returns NULL
and sets the global SmartSockets error number to one of:
TipcConnMsgSearchType is a convenience function that searches for a message with a specific type by calling TipcConnMsgSearch. The first message found in the connection’s message queue with that type is removed from the queue and returned.
Unless you pass the message returned by TipcConnMsgSearchType to another function that takes responsibility for destroying it (such as TipcConnMsgInsert), when the message is no longer needed destroy it by calling TipcMsgDestroy.
This code fragment waits up to 10 seconds for a CONTROL message to arrive from the other end of a connection:
mt = TipcMtLookupByNum(T_MT_CONTROL); if (mt == NULL) {return
; /* error */
} msg = TipcConnMsgSearchType(conn, 10.0, 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 |