Transport Interfaces Programming Guide
只搜尋這本書
以 PDF 格式下載這本書

............................Code Samples

Code Example 2-1 Bind Name to Socket15
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 Datagrams25
Code Example 2-5 Sending an Internet Domain Datagram27
Code Example 2-6 Check for Pending Connections With select()29
Code Example 2-7 Remote Login Server34
Code Example 2-8 Remote Login Server: Step 135
Code Example 2-9 Dissociating from the Controlling Terminal36
Code Example 2-10 Remote Login Server: Main Body36
Code Example 2-11 Output of ruptime Program38
Code Example 2-12 rwho Server39
Code Example 2-13 Flushing Terminal I/O on Receipt of Out-of-Band Data 42
Code Example 2-14 Set Nonblocking Socket43
Code Example 2-15 Making a Socket Asynchronous44
Code Example 2-16 Asynchronous Notification of I/O Requests45
Code Example 2-17 SIGCHLD Signal46
Code Example 2-18 Bind Port Number to Socket48
Code Example 2-19 net/if.h Header File50
Code Example 2-20 Obtaining Interface Flags51
Code Example 2-21 Broadcast Address of an Interface51
Code Example 3-22 CLTS Server63
Code Example 3-23 Data Transfer Routine65
Code Example 3-24 Client Implementation of Open and Bind73
Code Example 3-25 Server Implementation of Open and Bind75
Code Example 3-26 Client-to-Server Connection78
Code Example 3-27 accept_call Function81
Code Example 3-28 Spawning Child Process to Loopback and Listen86
Code Example 3-29 Read/Write Interface90
Code Example 3-30 Endpoint Establishment (Convertible to Multiple Connections)94
Code Example 3-31 Processing Connection Requests96
Code Example 3-32 Event Processing Routine97
Code Example 3-33 Process All Connect Requests99
Code Example 4-1 Sample netconfig File114
Code Example 4-2 The netconfig Structure115
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 Transports119
Code Example 4-7 Network Selection and Name-to-Address Mapping . 124