TipcSrvMsgSearchType


Name

TipcSrvMsgSearchType — search the message queue of a connection to RTserver for a message with a specific type

Synopsis

T_IPC_MSG TipcSrvMsgSearchType(timeout, mt) 
T_REAL8 timeout; 
T_IPC_MT mt; 

Arguments

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 TipcSrvMsgSearchType fails, it returns NULL and sets the global SmartSockets error number to one of:

Description

TipcSrvMsgSearchType 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.

TipcSrvMsgSearchType 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, TipcSrvMsgSearchType searches the messages in the warm connection. If no messages are queued in the warm connection, then TipcSrvMsgSearchType calls TutSleep with timeout, so that RTclient does not use an abnormal amount of CPU time. See TipcSrvCreate on automatic creation of connections and warm connections to RTserver.

Caution

The message returned by TipcSrvMsgSearchType 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 TipcSrvMsgInsert).

See Also

TipcConnMsgSearchType, TipcSrvMsgSearch

Examples

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 = TipcSrvMsgSearchType(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