The Linux Programming Interface
Sockets: Internet Domains 1217 as 0, ai_flags is assumed as (AI_V4MAPPED | AI_ADDRCONFIG), and ai_family is assumed as AF_UNSPEC ...
1218 Chapter 59 We can use the string returned by gai_strerror() as part of an error message dis- played by an application. 59.1 ...
Sockets: Internet Domains 1219 TCP and UDP ports. However, in the few instances where the names differ, the NI_DGRAM flag forces ...
1220 Chapter 59 z Ignore the SIGPIPE signal w. This prevents the server from receiving the SIGPIPE signal if it tries to write t ...
Sockets: Internet Domains 1221 Listing 59-6: An iterative server that uses a stream socket to communicate with clients ––––––––– ...
1222 Chapter 59 y if (setsockopt(lfd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) == -1) errExit("setsockopt"); u if ...
Sockets: Internet Domains 1223 h seqNum += reqLen; / Update sequence number / if (close(cfd) == -1) /* Close connection */ errMs ...
1224 Chapter 59 In the shell session log, we see that the kernel cycles sequentially through the ephemeral port numbers. (Other ...
Sockets: Internet Domains 1225 /* Connect failed: close this socket and try next address */ close(cfd); } if (rp == NULL) fatal( ...
1226 Chapter 59 Listing 59-8: Header file for inet_sockets.c ––––––––––––––––––––––––––––––––––––––––––––––––––––sockets/inet_so ...
Sockets: Internet Domains 1227 If addrlen is specified as a non-NULL pointer, then the location it points to is used to return t ...
1228 Chapter 59 Listing 59-9: An Internet domain sockets library ––––––––––––––––––––––––––––––––––––––––––––––––––––sockets/ine ...
Sockets: Internet Domains 1229 static int / Public interfaces: inetBind() and inetListen() / inetPassiveSocket(const char servic ...
1230 Chapter 59 freeaddrinfo(result); return (rp == NULL)? -1 : sfd; } int inetListen(const char *service, int backlog, socklen_ ...
Sockets: Internet Domains 1231 The inet_aton() function returns 1 if the conversion was successful, or 0 if str was invalid. The ...
1232 Chapter 59 The gethostbyname() function resolves the hostname given in name, returning a pointer to a statically allocated ...
Sockets: Internet Domains 1233 Listing 59-10 demonstrates the use of gethostbyname(). This program displays hostent information ...
1234 Chapter 59 printf(" address type: %s\n", (h->h_addrtype == AF_INET)? "AF_INET" : (h->h_addrtype == AF_INET6)? "AF_INE ...
Sockets: Internet Domains 1235 the one specified in port. (This may not return the desired result in the few cases mentioned abo ...
1236 Chapter 59 z [Sarolahti & Kuznetsov, 2002] describes congestion control and other details of the Linux TCP implementati ...
«
59
60
61
62
63
64
65
66
67
68
»
Free download pdf