TipcConnMsgSearchType


Name

TipcConnMsgSearchType — search the message queue of a connection for a message with a specific message type

Synopsis

T_IPC_MSG TipcConnMsgSearchType(conn, timeout, mt) 
T_IPC_CONN conn; 
T_REAL8 timeout; 
T_IPC_MT mt; 

Arguments

conn — connection to search

timeout — maximum number of seconds to wait for desired message to arrive

mt — desired message type

Return Values

A message if successful, NULL otherwise.

Diagnostics

If TipcConnMsgSearchType fails, it returns NULL and sets the global SmartSockets error number to one of:

Description

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.

Caution

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.

See Also

TipcConnMsgSearch

Examples

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