TipcConnAccept accept connection from client
server_conn
server connection
Connection to new client if successful, NULL
otherwise.
If TipcConnAccept fails, it returns NULL
and sets the global SmartSockets error number to one of:
TipcConnAccept accepts a connection from a new client by calling TutSocketAccept and returns a new connection to that client. The original connection is left open to accept more clients. TipcConnAccept blocks waiting for a client to connect if the block mode of the connection is TRUE
. See TipcConnGetBlockMode for information on connection block modes. TipcConnAccept also sets the size of the new connection’s socket send and receive buffers to 48K bytes with the function setsockopt.
To avoid blocking if no client is waiting to connect, use TipcConnCheck before calling TipcConnAccept.
TipcConnCheck; see the TIBCO SmartSockets Utilities for information on TutSocketAccept.
This example uses TipcConnCheck to wait for up to 10 seconds for a new client to connect, then accepts the new client with TipcConnAccept:
if (TipcConnCheck(server_conn, T_IO_CHECK_READ, 10.0)) { client_conn = TipcConnAccept(server_conn); if (client_conn == NULL) {
return
; /* error */
} } else {
return
; /* error */
}
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |