TipcSrvConnGetSocket


Name

TipcSrvConnGetSocket — determine the socket of the connection

Synopsis

T_BOOL TipcSrvConnGetSocket(srv, socket_return) 
T_IPC_SRV srv; 
T_INT4 *socket_return; 

Arguments

srv — connection handle to RTserver

socket_return — storage for connection socket

Return Values

TRUE if socket was successfully retrieved from the connection handle to RTserver, FALSE otherwise.

Diagnostics

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

Description

TipcSrvConnGetSocket gets the socket file descriptor of the connection to RTserver by calling TipcConnGetSocket. A socket is an operating system device which provides a communication link to another process. All data sent to and received from the connection is transmitted on this socket.

TipcSrvConnGetSocket may attempt to automatically create a connection to RTserver. If RTclient has a warm connection to RTserver, TipcSrvConnGetSocket does not use the warm connection, because the warm connection does not have a valid socket. See TipcSrvConnOpen for more information on automatic creation of connections and warm connections to RTserver.

Caution

If TipcSrvConnGetSocket returns FALSE, it does not store a value in socket_return.

See Also

TipcConnGetSocket, TipcSrvConnGetXtSource

Examples

This example gets the connection handle to RTserver and prints the socket of the connection:

T_IPC_SRV srv; 
T_INT4 socket_return; 
if (!TipcSrvConnOpen(srv, T_IPC_SRV_CONN_FULL)) { 
  return;  /* error */ 
}  
if (!TipcSrvConnGetSocket(srv, &socket_return)) { 
  return;  /* error */ 
}  
TutOut("Socket of connection to RTserver is <%d>.\n", 
socket_return); 

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