TipcSrvConnGetConnStatus


Name

TipcSrvConnGetConnStatus — get the status of the connection

Synopsis

T_BOOL TipcSrvConnGetConnStatus(srv, conn_status_return) 
T_IPC_SRV srv; 
T_IPC_SRV_CONN_STATUS *conn_status_return; 

Arguments

srv — connection handle to RTserver

conn_status_return — storage for connection status

Return Values

TRUE if connection status was successfully retrieved, FALSE otherwise.

Diagnostics

If TipcSrvConnGetConnStatus fails, it returns FALSE and sets the global SmartSockets error number to:

Description

TipcSrvConnGetConnStatus gets the status of the connection handle to RTserver. A connection status of T_IPC_SRV_CONN_FULL indicates that the RTclient does have a connection to RTserver. A connection status of T_IPC_SRV_CONN_WARM indicates that the RTclient has a warm connection to RTserver. A connection status of T_IPC_SRV_CONN_NONE indicates that the RTclient does not have a connection to RTserver. See TipcSrvConnOpen for more information on automatic creation of connections and warm connections to RTserver, and TipcSrvConnClose for more on destroying the connection to RTserver.

Caution

If TipcSrvConnGetConnStatus returns FALSE, it does not store a value in conn_status_return.

See Also

TipcSrvConnCreate, TipcSrvConnDestroy

Examples

This example uses TipcSrvConnGetConnStatus to ensure that the RTclient has some kind of connection to RTserver:

T_IPC_SRV srv; 
T_IPC_SRV_CONN_STATUS conn_status_return; 
 
if (!TipcSrvConnGetConnStatus(srv, &conn_status_return)) { 
  return;  /* error */ 
}  
if (conn_status == T_IPC_SRV_CONN_NONE) { 
  TutOut("This process has no connection to RTserver.\n"); 
  if (!TipcSrvConnOpen(srv, T_IPC_SRV_CONN_FULL)) { 
    return;  /* error */ 
  }  
} 

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