The Linux Programming Interface: a linux and unix system Programming Handbook



tải về 6.93 Mb.
Chế độ xem pdf
trang41/806
Chuyển đổi dữ liệu08.07.2022
Kích6.93 Mb.
#52607
1   ...   37   38   39   40   41   42   43   44   ...   806
The Linux Programming Interface

60
SOCKETS: SERVER DESIGN
 1239
60.1
Iterative and Concurrent Servers................................................................................ 1239
60.2
An Iterative UDP 
echo
Server ..................................................................................... 1240
60.3
A Concurrent TCP 
echo
Server................................................................................... 1243
60.4
Other Concurrent Server Designs .............................................................................. 1245
60.5
The 
inetd
(Internet Superserver) Daemon .................................................................... 1247
60.6
Summary................................................................................................................ 1252
60.7
Exercises ................................................................................................................ 1252
61
SOCKETS: ADVANCED TOPICS
 1253
61.1
Partial Reads and Writes on Stream Sockets ............................................................... 1254
61.2
The 
shutdown()
System Call ...................................................................................... 1256
61.3
Socket-Specific I/O System Calls: 
recv()
and 
send()
..................................................... 1259
61.4
The 
sendfile()
System Call......................................................................................... 1260
61.5
Retrieving Socket Addresses ..................................................................................... 1263
61.6
A Closer Look at TCP ............................................................................................... 1266
61.6.1
Format of a TCP Segment..................................................................... 1266
61.6.2
TCP Sequence Numbers and Acknowledgements.................................... 1268
61.6.3
TCP State Machine and State Transition Diagram ................................... 1269
61.6.4
TCP Connection Establishment .............................................................. 1270
61.6.5
TCP Connection Termination ................................................................ 1272
61.6.6
Calling 
shutdown()
on a TCP Socket...................................................... 1273
61.6.7
The TIME_WAIT State.......................................................................... 1274
61.7
Monitoring Sockets: 
netstat
....................................................................................... 1275
61.8
Using 
tcpdump
to Monitor TCP Traffic ........................................................................ 1276
61.9
Socket Options ....................................................................................................... 1278
61.10 The SO_REUSEADDR Socket Option................................................................................ 1279
61.11 Inheritance of Flags and Options Across 
accept()
......................................................... 1281


xxviii
Contents in Detail
61.12 TCP Versus UDP ...................................................................................................... 1282
61.13 Advanced Features.................................................................................................. 1283
61.13.1
Out-of-Band Data ................................................................................ 1283
61.13.2
The 
sendmsg()
and 
recvmsg()
System Calls.............................................. 1284
61.13.3
Passing File Descriptors ....................................................................... 1284
61.13.4
Receiving Sender Credentials ............................................................... 1284
61.13.5
Sequenced-Packet Sockets.................................................................... 1285
61.13.6
SCTP and DCCP Transport-Layer Protocols ............................................. 1285
61.14 Summary................................................................................................................ 1286
61.15 Exercises ................................................................................................................ 1287

tải về 6.93 Mb.

Chia sẻ với bạn bè của bạn:
1   ...   37   38   39   40   41   42   43   44   ...   806




Cơ sở dữ liệu được bảo vệ bởi bản quyền ©hocday.com 2024
được sử dụng cho việc quản lý

    Quê hương