Advanced Programming in the UNIX® Environment
ptg10805159 Chapter 15 Exercises 587 To use this technique with XSI IPC, recall that theipc_permstructureassociated with each me ...
ptg10805159 588 Interprocess Communication Chapter 15 15.6 The Rationale for POSIX.1 gives as one of the reasons for adding thew ...
ptg10805159 16 Networ k IPC: Sockets 16.1 Introduction In the previous chapter, we looked at pipes, FIFOs, message queues, semap ...
ptg10805159 590 Network IPC: Sockets Chapter 16 16.2 SocketDescr iptors Asocket is an abstraction of a communication endpoint. J ...
ptg10805159 Section 16.2 Socket Descriptors 591 TCP(Tr ansmission Control Protocol).The default protocol for aSOCK_DGRAMsocket i ...
ptg10805159 592 Network IPC: Sockets Chapter 16 to create a raw socket to prevent malicious applications from creating packets t ...
ptg10805159 Section 16.3 Addressing 593 Given that we cancloseasocket, why isshutdownneeded? Thereare several reasons. First,clo ...
ptg10805159 594 Network IPC: Sockets Chapter 16 byte would contain 1, regardless of the byte ordering. If we werethen to cast a ...
ptg10805159 Section 16.3 Addressing 595 16.3.2 AddressFormats An address identifies a socket endpoint in a particular communicat ...
ptg10805159 596 Network IPC: Sockets Chapter 16 struct sockaddr_in6 { sa_family_t sin6_family; /* address family */ in_port_t si ...
ptg10805159 Section 16.3 Addressing 597 16.3.3 Address Lookup Ideally, an application won’t have to be aware of the internal str ...
ptg10805159 598 Network IPC: Sockets Chapter 16 We can get network names and numbers with a similar set of interfaces. #include ...
ptg10805159 Section 16.3 Addressing 599 number with getservbyname,map a port number to a service name with getservbyport, or sca ...
ptg10805159 600 Network IPC: Sockets Chapter 16 Theaddrinfostructure is defined to include at least the following members: struc ...
ptg10805159 Section 16.3 Addressing 601 The socket address (addr) is translated into a host name and a service name. Ifhostis no ...
ptg10805159 602 Network IPC: Sockets Chapter 16 printf("unspecified"); break; default: printf("unknown"); } } void print_type(st ...
ptg10805159 Section 16.3 Addressing 603 void print_flags(struct addrinfo *aip) { printf("flags"); if (aip->ai_flags == 0) { p ...
ptg10805159 604 Network IPC: Sockets Chapter 16 sinp = (struct sockaddr_in *)aip->ai_addr; addr = inet_ntop(AF_INET, &sin ...
ptg10805159 Section 16.4 Connection Establishment 605 •The port number in the address cannot be less than 1,024 unless the proce ...
ptg10805159 606 Network IPC: Sockets Chapter 16 The address we specify withconnectis the address of the server with which we wis ...
«
27
28
29
30
31
32
33
34
35
36
»
Free download pdf