| |
| Code Example 2-1 Bind Name to Socket | 15 |
| Code Example 2-2 Internet Domain Stream Connection (Client) | 20 |
| Code Example 2-3 Accepting an Internet Stream Connection (Server) | 22 |
| Code Example 2-4 Reading Internet Domain Datagrams | 25 |
| Code Example 2-5 Sending an Internet Domain Datagram | 27 |
| Code Example 2-6 Check for Pending Connections With select() | 29 |
| Code Example 2-7 Remote Login Server | 34 |
| Code Example 2-8 Remote Login Server: Step 1 | 35 |
| Code Example 2-9 Dissociating from the Controlling Terminal | 36 |
| Code Example 2-10 Remote Login Server: Main Body | 36 |
| Code Example 2-11 Output of ruptime Program | 38 |
| Code Example 2-12 rwho Server | 39 |
| Code Example 2-13 Flushing Terminal I/O on Receipt of Out-of-Band Data 42 |
| Code Example 2-14 Set Nonblocking Socket | 43 |
| Code Example 2-15 Making a Socket Asynchronous | 44 |
| Code Example 2-16 Asynchronous Notification of I/O Requests | 45 |
| |
| Code Example 2-17 SIGCHLD Signal | 46 |
| Code Example 2-18 Bind Port Number to Socket | 48 |
| Code Example 2-19 net/if.h Header File | 50 |
| Code Example 2-20 Obtaining Interface Flags | 51 |
| Code Example 2-21 Broadcast Address of an Interface | 51 |
| Code Example 3-22 CLTS Server | 63 |
| Code Example 3-23 Data Transfer Routine | 65 |
| Code Example 3-24 Client Implementation of Open and Bind | 73 |
| Code Example 3-25 Server Implementation of Open and Bind | 75 |
| Code Example 3-26 Client-to-Server Connection | 78 |
| Code Example 3-27 accept_call Function | 81 |
| Code Example 3-28 Spawning Child Process to Loopback and Listen | 86 |
| Code Example 3-29 Read/Write Interface | 90 |
| Code Example 3-30 Endpoint Establishment (Convertible to Multiple Connections) | 94 |
| Code Example 3-31 Processing Connection Requests | 96 |
| Code Example 3-32 Event Processing Routine | 97 |
| Code Example 3-33 Process All Connect Requests | 99 |
| Code Example 4-1 Sample netconfig File | 114 |
| Code Example 4-2 The netconfig Structure | 115 |
| Code Example 4-3 setnetpath(), getnetpath(), and endnetpath()117 |
| Code Example 4-4 setnetconfig(), getnetconfig(), and endnetconfig() | 118 |
| Code Example 4-5 getnetconfigent() and freenetconfigent() 119 |
| Code Example 4-6 Looping Through Visible Transports | 119 |
| Code Example 4-7 Network Selection and Name-to-Address Mapping . 124 |