TipcSrvConnCheck


Name

TipcSrvConnCheck — check if data can be read from or written to the connection

Synopsis

T_BOOL TipcSrvConnCheck(srv, check_mode, timeout) 
T_IPC_SRV srv; 
T_IO_CHECK_MODE check_mode; 
T_REAL8 timeout; 

Arguments

srv — connection handle to RTserver

check_mode — how to check RTserver availability

timeout — maximum number of seconds to wait for availability

Return Values

TRUE if data can be read or written, FALSE if timeout reached or an error occurred.

Diagnostics

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

Description

TipcSrvConnCheck checks the connection to RTserver by calling TipcConnCheck. The connection can be checked if data can be read (check_mode is T_IO_CHECK_READ) or if data can be written (check_mode is T_IO_CHECK_WRITE). See TipcConnCheck for more information on checking connections.

TipcSrvConnCheck may attempt to automatically create a connection to RTserver. If RTclient has a warm connection to RTserver, TipcSrvConnCheck sleeps for timeout seconds and returns FALSE. See TipcSrvConnRead on automatic creation of connections and warm connections to RTserver.

Caution

TipcSrvConnCheck is a low-level function that is normally not used directly by developers. TipcConnCheck is normally called only by TipcSrvConnFlush and TipcSrvConnRead.

See Also

TipcConnCheck, TipcSrvConnRead

Example

This example uses TipcSrvConnCheck to check if data is available within 3.4 seconds for reading from the connection to RTserver:

if (!TipcSrvConnCheck(srv, T_IO_CHECK_READ, 3.4)) { 
  return;  /* error */ 
}  

TIBCO SmartSockets™ Application Programming Interface
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com