The Linux Programming Interface
Sockets: Advanced Topics 1257 However, if we make the following sequence of calls, then both channels of the connection are clos ...
1258 Chapter 61 Listing 61-2: A client for the echo service ––––––––––––––––––––––––––––––––––––––––––––––––––––––sockets/is_ech ...
Sockets: Advanced Topics 1259 61.3 Socket-Specific I/O System Calls: recv() and send() The recv() and send() system calls perfor ...
1260 Chapter 61 All of the above flags are specified in SUSv3, except for MSG_DONTWAIT, which is never- theless available on som ...
Sockets: Advanced Topics 1261 and the other to copy the user-space buffer back to kernel space in order to be transmitted via th ...
1262 Chapter 61 The count argument specifies the number of bytes to be transferred. If end-of- file is encountered before count ...
Sockets: Advanced Topics 1263 We could avoid the possibility of two segments being transmitted by building a single data buffer ...
1264 Chapter 61 The getpeername() system call returns the address of the peer socket on a stream socket connection. This is usef ...
Sockets: Advanced Topics 1265 Listing 61-3: Using getsockname() and getpeername() –––––––––––––––––––––––––––––––––––––––––––––– ...
1266 Chapter 61 61.6 A Closer Look at TCP Knowing some of the details of the operation of TCP helps us to debug applications tha ...
Sockets: Advanced Topics 1267 z Acknowledgement number: If the ACK bit (see below) is set, then this field con- tains the sequen ...
1268 Chapter 61 allow the receiving TCP to double-check that an incoming segment has arrived at the correct destination (i.e., t ...
Sockets: Advanced Topics 1269 Figure 61-3 and later similar diagrams are intended to illustrate the exchange of TCP segments bet ...
1270 Chapter 61 z LAST_ACK: The application performed a passive close, and the TCP, formerly in the CLOSE_WAIT state, sent a FIN ...
Sockets: Advanced Topics 1271 (labeled M in the diagram). This information is necessary because sequence numbers don’t begin at ...
1272 Chapter 61 The SYN segments exchanged in the first two steps of the three-way handshake may contain information in the opti ...
Sockets: Advanced Topics 1273 As with the SYN flag, and for the same reasons, the FIN flag consumes a byte of the sequence-numbe ...
1274 Chapter 61 61.6.7 The TIME_WAIT State The TCP TIME_WAIT state is a frequent source of confusion in network program- ming. L ...
Sockets: Advanced Topics 1275 To understand the second purpose of the TIME_WAIT state—ensuring the expiration of old duplicate s ...
1276 Chapter 61 Here is an abridged example of the output that we see when using netstat to list all Internet domain sockets on ...
«
61
62
63
64
65
66
67
68
69
70
»
Free download pdf