Title: Sockets
1 Sockets
Chapter 10 from the book Inter-process
Communications in Linux The Nooks Crannies
by John Shapley Gray Publisher Prentice Hall
Pub Date January 13, 2003
2Topics
COMMUNICATION BASICS
3Network Addresses
COMMUNICATION BASICS
4COMMUNICATION BASICS
Figure 10.1. Displaying the MAC addresses on a
Linux host.
5COMMUNICATION BASICS
Figure 10.1. Displaying the MAC addresses on a
Linux host.
6Network Addresses
COMMUNICATION BASICS
7Network Addresses
COMMUNICATION BASICS
Figure 10.2. Network class numbering scheme.
8Domains
COMMUNICATION BASICS
9Domains
COMMUNICATION BASICS
10Domains
COMMUNICATION BASICS
11Protocol Families
COMMUNICATION BASICS
12COMMUNICATION BASICS
Figure 10.3. The ISO/OSI layer cake.
13Protocol Families
COMMUNICATION BASICS
14Protocol Families
COMMUNICATION BASICS
15Socket Types
COMMUNICATION BASICS
16Socket Types
COMMUNICATION BASICS
17Socket Types
COMMUNICATION BASICS
18IPC Using Socketpair
19IPC Using Socketpair
Table 10.1. Summary of the socketpair System Call
20IPC Using Socketpair
21IPC Using Socketpair
Table 10.2. Protocol Family Constants.
22IPC Using Socketpair
Table 10.2. Protocol Family Constants.
23IPC Using Socketpair
Table 10.2. Protocol Family Constants.
24IPC Using Socketpair
25IPC Using Socketpair
26IPC Using Socketpair
27IPC Using Socketpair
Table 10.3. socketpair Error Messages..
28IPC Using Socketpair
29IPC Using Socketpair
Figure 10.5. The socketpair before and after the
process forks.
30The Connection-Oriented Paradigm
31The Connection-Oriented Paradigm
Figure 10.6. A connection-oriented clientserver
communication sequence.
32The Connection-Oriented Paradigm
33The Connection-Oriented Paradigm
Table 10.4. Summary of the socket System Call.
34The Connection-Oriented Paradigm
35The Connection-Oriented Paradigm
Table 10.5. Supported Protocol Families.
36The Connection-Oriented Paradigm
37The Connection-Oriented Paradigm
38The Connection-Oriented Paradigm
Table 10.6. socket Error Messages.
39The Connection-Oriented Paradigm
40The Connection-Oriented Paradigm
Table 10.7. Summary of the bind System Call
41The Connection-Oriented Paradigm
42The Connection-Oriented Paradigm
43The Connection-Oriented Paradigm
Table 10.8. bind Error Messages.
44The Connection-Oriented Paradigm
Table 10.8. bind Error Messages.
45The Connection-Oriented Paradigm
46The Connection-Oriented Paradigm
Table 10.9. Summary of the listen System Call.
47The Connection-Oriented Paradigm
48The Connection-Oriented Paradigm
Table 10.10. listen Error Messages.
49The Connection-Oriented Paradigm
50The Connection-Oriented Paradigm
Table 10.11. Summary of the accept System Call.
51The Connection-Oriented Paradigm
52The Connection-Oriented Paradigm
Table 10.12. accept Error Messages.
53The Connection-Oriented Paradigm
Table 10.12. accept Error Messages.
54The Connection-Oriented Paradigm
Table 10.12. accept Error Messages.
55The Connection-Oriented Paradigm
56The Connection-Oriented Paradigm
Table 10.13. Summary of the connect System Call.
57The Connection-Oriented Paradigm
58The Connection-Oriented Paradigm
59The Connection-Oriented Paradigm
Table 10.14. connect Error Messages.
60The Connection-Oriented Paradigm
Table 10.14. connect Error Messages.
61The Connection-Oriented Paradigm
Table 10.14. connect Error Messages.
62The Connectionless Paradigm
63The Connectionless Paradigm
Figure 10.14. A connectionless clientserver
communication sequence.
64The Connectionless Paradigm
65The Connectionless Paradigm
Table 10.19. Summary of the send, sendto, and
sendmsg System Calls.
66The Connectionless Paradigm
Table 10.20. Flags for the send, sendto, and
sendmsg Calls.
67The Connectionless Paradigm
Table 10.21. send, sendto, and sendmsg Error
Messages.
68The Connectionless Paradigm
Table 10.21. send, sendto, and sendmsg Error
Messages.
69The Connectionless Paradigm
70The Connectionless Paradigm
Table 10.22. Summary of the recv, recvfrom, and
recvmsg System Calls.
71The Connectionless Paradigm
Table 10.23. Flags for the recv, recvfrom, and
recvmsg Calls.
72The Connectionless Paradigm
Table 10.24. recv, recvfrom, and recvmsg Error
Messages