TCP/IP Programming Manual

address-port number combination returned by accept_nw is passed to accept_nw2 to
establish the connection on the new socket.
The call to accept_nw made prior to this call may be made in another process, such as the
LISTNER process.
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 *. (See the IPv6 example.)
Applications doing ACCEPT_NW2 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.)
Example
See accept_nw (page 91), which also calls accept_nw2.
accept_nw3
The accept_nw3 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_nw3.
C Synopsis
#include <socket.h>
#include <in.h>
#include <in6.h> /* For IPv6 use */
#include <netdb.h>
error = accept_nw3 (new_socket, from_ptr, me_ptr, tag);
int error, new_socket;
struct sockaddr *from_ptr, *me_ptr;
long tag;
TAL Synopsis
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
error := accept_nw3 (new_socket, from_ptr, me_ptr, tag);
INT(32) error;
INT(32) new_socket;
INT .EXT from_ptr(sockaddr_in);
INT .EXT me_ptr(sockaddr_in);
INT(32) tag;
error
return value; if the call is successful, a zero is returned. If the call is not successful, –1 is returned.
If the call failed, the external variable errno is set as indicated in Errors (page 98).
new_socket
input value; the socket number for the new socket on which the connection is to be accepted,
as returned by a call to socket_nw.
from_ptr
input value; points to the address and port number returned from the call to accept_nw or
accept_nw1.
me_ptr
input value; points to the local address and port number used by bind_nw.
accept_nw3 97