TCP/IP Programming Manual
from_len1
input and return value; points to a value indicating the size in bytes of the structure pointed to
by from_ptr.
tag
input value; the tag parameter to be used for the nowait operation.
queue_length
input value; specifies the maximum queue length (number of pending connections). Values are
1 through 128.
Errors
If an error occurs, the external variable errno is set to one of the following values:
There is already an outstanding call on the socket.EALREADY
The connection was reset by the peer process before the accept_nw operation completed.ECONNRESET
An invalid argument was specified.EINVAL
Usage Guidelines
• Use the accept_nw1 call instead of the accept_nw call when you need to set the queue
length.
• This is a nowait call; it must be completed with a call to the Guardian procedure AWAITIOX.
For a waited call, use accept.
• The accept_nw1 call causes TCP/IP to do a listen and accept in one call.
• The accept_nw1 function must be followed first by a call to socket_nw to create a new
socket and then by a call to accept_nw2. The from_ptr parameter from accept_nw1 is
passed to accept_nw2, which accepts the connection on the new socket.
• Use accept_nw2 after this call.
• Declare the from_ptr variable as struct sockaddr_in6 * for IPv6 use or as struct
sockaddr_storage * for protocol-independent use. In C, when you make the call, cast
the variable to sockaddr *.
• For the Conventional TCP/IP product only, it is not recommended to use CANCEL or CANCELREQ
calls with accept_nw1. While this procedure works as expected with IPv6 and CIP products,
with Conventional TCP/IP, accept_nw1 causes a pending incoming connection to be
immediately marked as allocated and the cancel does not undo this. Subsequent accept_nw1
requests require additional incoming connections for the requests to complete. Because the
connection has been marked allocated it cannot be accepted by a subsequent accept_nw1.
accept_nw2
The accept_nw2 function accepts a connection on a new socket created for nowait data transfer.
Before calling this procedure, a program should call accept_nw on an existing socket and then
call socket_nw to create the new socket to be used by accept_nw2.
C Synopsis
#include <socket.h>
#include <in.h>
#include <in6.h> /* For IPv6 use */
#include <netdb.h>
error = accept_nw2 (new_socket, from_ptr, tag);
 int error, new_socket;
accept_nw2 95










