TCP/IP Programming Manual

perror ("Server Socket 2 create failed.");
exit (0);
}
else {
/* Call AWAITIOX using socket fd2. */
}...
if ((cc = accept_nw2(fd2, (struct sockaddr *)&from, t)) < 0) {
perror ("Server: Accept failed.");
exit (0);
}
else {
/* Call AWAITIOX using socket fd2 and tag t. */
...
}
accept_nw1
accept_nw1 can be used instead of accept_nw; use accept_nw1 to set the maximum
connections in the queue awaiting acceptance on a socket.
C Synopsis
#include <socket.h>
#include <in.h.>
#include <in6.h> /* if using IPv6 */
#include <netdb.h>
error = accept_nw1 (socket, from_ptr, from_len1, tag, queue_length);
int error, socket;
struct sockaddr *from_ptr;
int *from_len1;
long tag;
int queue_length;
TAL Synopsis
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
error := accept_nw1 (socket, from_ptr, from_len1, tag, queue_length);
INT(32) error;
INT(32) socket;
INT .EXT from_ptr (sockaddr_in);
INT.EXT from_len1;
INT(32) tag;
INT(32) queue_length;
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 95).
socket
input value; specifies the socket number, created by a previous socket_nw call, to be used
to check for connections.
from_ptr
input and return value; points, on return, to the remote address and port number for the new
connection from which the connection was initiated.
94 Library Routines