TCP/IP Programming Manual

tag
input value; the tag parameter to be used for the nowait operation.
Errors
If an error occurs, the external variable errno is set to one of the following values:
Accept_nw3() posted on an already-bound socket. (For Parallel Library TCP/IP and
NonStop TCP/IPv6 only.)
EADDRINUSE
Operation is already in progress. (For Parallel Library TCP/IP and NonStop TCP/IPv6
only.)
EALREADY
The connection was reset by the peer process before the accept operation completed.
This error also can be received when a call was done on a socket when the socket
was in an incorrect state.
ECONNRESET
An invalid argument was specified.EINVAL
Socket is already connected. (For Parallel Library TCP/IP and NonStop TCP/IPv6
only.)
EISCONN
No Buffer Space available. (For Parallel Library TCP/IP and NonStop TCP/IPv6 only.)ENOBUF
The socket specified in the new_socket parameter was invalid. Close the socket
using the FILE_CLOSE call. Repeat the accept_nw, socket_nw and accept_nw3
sequence of calls.
ERSCH
Usage Guidelines
This is a nowait call; it must be completed with a call to the AWAITIOX procedure. For a
waited call, use accept.
The accept_nw and accept_nw3 functions work together. The accept_nw function checks
for connections on an existing nowait socket. When a connection request arrives, the
accept_nw function returns the address and port number from which the connection request
came. A new socket is then created with socket_nw. Finally, the new socket number returned
by socket_nw and the address-port number combination returned by accept_nw is passed
to accept_nw3 to establish the connection on the new socket.
The call to accept_nw made prior to this call can be made in another process, such as the
LISTNER process.
Declare the from_ptr and me_ptr variables 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 *. (See the IPv6 example.)
Applications doing ACCEPT_NW3 calls can only see listening applications in the same LNP.
(H-series and G06.22 and later G-series RVUs of NonStop TCP/IPv6 only.)
bind, bind_nw
The bind and bind_nw functions associate a socket with a specific local Internet address and
port number.
C Synopsis
#include <socket.h>
#include <in.h>
#include <in6.h> /* for IPv6 use */
#include <netdb.h>
error = bind (socket, address_ptr, address_len);
error = bind_nw (socket, address_ptr, address_len, tag);
98 Library Routines