TipcConnAccept


Name

TipcConnAccept — accept connection from client

Synopsis

T_IPC_CONN TipcConnAccept(server_conn) 
T_IPC_CONN server_conn; 

Arguments

server_conn — server connection

Return Values

Connection to new client if successful, NULL otherwise.

Diagnostics

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

Description

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.

Caution

To avoid blocking if no client is waiting to connect, use TipcConnCheck before calling TipcConnAccept.

See Also

TipcConnCheck; see the TIBCO SmartSockets Utilities for information on TutSocketAccept.

Examples

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