TCP/IP Programming Manual

flen = sizeof(from);
if ((cc = accept_nw(fd1, (struct sockaddr *)&from, flen,
t)) < 0) {
perror ("Server: Accept failed.");
exit (0);
}
else {
/* Call AWAITIOX using socket fd1 and tag t. */
...
}
if ((fd2 = socket_nw(AF_INET, SOCK_STREAM,,1,1)) < 0) {
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. */
...
}
INET6: the following Parallel Library TCP/IP IPv6 server programming example calls accept_nw,
socket_nw, and accept_nw2. This call accepts a connection on the new socket fd2 created
for nowait data transfer.
#include <socket.h>
#include <in.h>
#include <in6.h>
#include <netdb.h>
...
struct sockaddr_in6 from;
...
if ((fd1 = socket_nw(AF_INET6, SOCK_STREAM,,1,1)) < 0) {
perror ("Server Socket 1 create failed.");
exit (0);
/* Call AWAITIOX */
}
/* Before calling accept_nw, program must call bind_nw and
* listen. A call to AWAITIOX must follow the bind_nw call.
*/
flen = sizeof(from);
/* Notice that from is cast as struct sockaddr * as suggested in
the Usage Guidelines */
if ((cc = accept_nw(fd1, (struct sockaddr *)&from, flen,
t)) < 0) {
perror ("Server: Accept failed.");
exit (0);
}
else {
/* Call AWAITIOX using socket fd1 and tag t. */
...
}
if ((fd2 = socket_nw(AF_INET6, SOCK_STREAM,,1,1)) < 0) {
accept_nw 93