Formatted contents note |
Chapter 1 Introduction And Overview<br/>1.1 Use Of TCP/IP<br/>1.2 Designing Applications For A Distributed Environment<br/>1.3 Standard And Nonstandard Application Protocols<br/>1.4 An Example Of Standard Application Protocol Use<br/>1.5 An Example Connection<br/>1.6 Using TELNET To Access An Alternative Service<br/>1.7 Application Protocols And Software Flexibility<br/>1.8 Viewing Services From The Provider's Perspective<br/>1.9 The Remainder Of This Text<br/>Chapter 2 The Client Server Model And Software Design<br/>2.1 Introduction<br/>2.2 Motivation<br/>2.3 Terminology And Concepts -<br/>2.3.1 Clients And Servers<br/>2.3.2 Privilege And Complexity<br/>2.3.3 Standard Vs. Nonstandard Client Software<br/>2.3.4 Parameterization Of Clients<br/>2.3.5 Connectionless Vs. Connection-Oriented Servers<br/>2.3.6 Stateless Vs. Stateful Servers<br/>2.3.7 A Stateful File Server Example<br/>2.3.8 Statelessness Is A Protocol Issue<br/>2.3.9 Servers As Clients<br/>Chapter 3 Concurrent Processing In Client-Server Software<br/>3.1 Introduction<br/>3.2 Concurrency In Networks<br/>3.3 Concurrency In Servers<br/>3.4 Terminology And Concepts<br/>3.4.1 The Process Concept<br/>3.4.2 Programs vs. Processes<br/>3.4.3 Procedure Calls<br/>3.5 An Example Of Concurrent Process Creation<br/>3.5.1 A Sequential C Example<br/>3.5.2 A Concurrent Version<br/>3.5.3 Timeslicing<br/>. 3.5.4 Making Processes Diverge<br/>3.6 Executing New Code<br/>3.7 Context Switching And Protocol Software Design<br/>3.8 Concurrency And Asynchronous 1/0<br/>Chapter 4 Program Interface To Protocols<br/>4.1 Introduction<br/>4.2 Loosely Specified Protocol Software Interface<br/>4.2.1 Advantages And Disadvantages<br/>4.3 Interface Functionality<br/>4.4 Conceptual Interface Specification<br/>4.5 System Calls<br/>4.6 Two Basic Approaches To Network Communication<br/>4.7 The Basic I/O Functions Available In UNIX<br/>4.8 Using UNIX I/O With TCP/IP<br/>Chapter 5 The Socket Interface<br/>5.1 Introduction<br/>5.2 Berkeley Sockets<br/>5.3 Specifying A Protocol Interface<br/>5.4 The Socket Abstraction 45<br/>5.4.1 Socket Descriptors And File Descriptors 45<br/>5.4.2 System Data Structures For Sockets 46<br/>5.4.3 Using Sockets 47<br/>5.5 Specifying An Endpoint Address 47<br/>5.6 A Generic Address Structure 48<br/>5.7 Major System Calls Used With Sockets 49<br/>5.7.1 The Socket Call 49<br/>5.7.2 The Connect Call 50<br/>5.7.3 The Write Call 50<br/>5.7.4 The Read Call 50<br/>5.7.5 The Close Call 50<br/>5.7.6 The Bind Call 51<br/>5.7.7 The Listen Call 51<br/>5.7.8 The Accept Call 51<br/>5.7.9 Summary Of Socket Calls Used With TCP 51<br/>5.8 Utility Routines For Integer Conversion 52<br/>5.9 Using Socket Calls In A Program 53<br/>5.10 Symbolic Constants For Socket Call Parameters 54<br/>5.11 Summary 54<br/>Chapter 6 Algorithms And Issues In Client Software Design<br/>• 6.1 Introduction 57<br/>6.2 Learning Algorithms Instead Of Details 57<br/>6.3 Client Architecture 58<br/>6.4 Identifying The Location Of A Server 58<br/>6.5 Parsing An Address Argument 60<br/>6.6 Looking Up A Domain Name 61<br/>§.7 Looking Up A Well-Known Port By Name 62<br/>6.8 Port Numbers And Network Byte Order 62<br/>6.9 Looking Up A Protocol By Name 63<br/>6.10 The TCP Client Algorithm 63<br/>6.11 Allocating A Socket 64<br/>6.12 Choosing A Local Protocol Port Number 65<br/>6.13 A Fundamental Problem In Choosing A Local IP Address 65<br/>6.14 Connecting A TCP Socket To A Server 66<br/>6.15 Communicating With The Server Using TCP 66<br/>6.16 Reading A Response From A TCP Connection 67<br/>6.17 Closing A TCP Connection 68<br/>6./»7.7 The Need For Partial Close 68<br/>6.17.2 A Partial Close Operation 68<br/>6.18 Programming A UDP Client 69<br/>6.19 Connected And Unconnected UDP Sockets 69<br/>6.20 Using Connect With UDP 70<br/>6.21 Communicating With A Server Using UDP 70<br/>6.22 Closing A Socket That Uses UDP 70<br/>6.23 Partial Close For UDP 71<br/>6.24 A Warning About UDP Unreliability 71<br/>6.25 -Summary 71<br/>Chapter 7 Example Client Software<br/>7.1 Introduction 75<br/>7.2 The Importance Of Small Examples 75<br/>7.3 Hiding Details 76<br/>7.4 An Example ^ocedure Library For Client Programs 76<br/>7.5 Implementation Of ConnectTCP 77<br/>7.6 Iihplementation Of ConnectUDP 78<br/>7.7 A Procedure That Forms Connections 79<br/>7.8 Using The Example Library 81<br/>7.9 The DAYTIME Service 82<br/>7.10 Implementation Of A TCP Client For DAYTIME 82<br/>7.11 Reading From A TCP Connection 84<br/>7.72 The TIME Service 84<br/>7.13 Accessing The TIME Service 85<br/>7.14 Accurate Times And Network Delays 85<br/>7.75 A UDP Client For The TIME Service 86<br/>7.76 The ECHO Service 88<br/>7.77 A TCP Client For The ECHO Service 88<br/>7.18 A UDP Client For The ECHO Service 90<br/>7.79 Summary 92<br/>Chapter 8 Algorithms And Issues In Server Software Design<br/>8.7 IntradubtioH 95 ,<br/>8.2 The Conceptual Server Algorithm 95<br/>8.3 Concurrent Vs. Iterative.Servers 96 ■<br/>8.4 Connection-Oriented Vs. Connectionless Access 96<br/>8.5 Connection-Oriented Servers 97<br/>8.6 Connectionless Servers 91 '<br/>8.7 Failure, Reliability, And Statelessness 98<br/>8.8 Optimizing Stateless Servers 99<br/>8.9 Four Basic Types Of Servers 101<br/>8.10 Request Processing Time 102<br/>8.11 Iterative Server Algorithms 102<br/>8.12 An Iterative, Connection-Oriented Server Algorithm 103<br/>8.13 Binding To A Well-Known Address Using 1NADDR_ANY 103<br/>8.14 Placing The Socket In Passive Mode 104<br/>8.15 Accepting Connections And Using Them 104<br/>8.16 An Iterative, Connectionless Server Algorithm 104<br/>8.17 Forming A Reply Address In A Connectionless Server 105<br/>8.18 Concurrent Server Algorithms 106<br/>8.19 Master And Slave Processes 106<br/>8.20 A Concurrent, Connectionless Server Algorithm 107<br/>8.21 A Concurrent, Connection-Oriented Server Algorithm 107<br/>8.22 Using Separate Programs As Slaves 108<br/>8.23 Apparent Concurrency Using A Single Process 109<br/>8.24 When To Use Each Server Type 110<br/>8.25 A Summary of Server Types 111<br/>8.26 The Important Problem Of Server Deadlock 112<br/>8.27 Alternative Implementations 112<br/>8.28 Summary 113<br/>Chapter 9 Iterative. Connectionless Servers (UDP)<br/>9.1 Introduction 115<br/>9.2 Creating A Passive Socket 115<br/>9.3 Process Structure 119<br/>9.4 An Example TIME Server 119<br/>9.5 Summary 121<br/>Chapter 10 iterative, Connection-Oriented Servers (TCP)<br/>10.1 Introduction 123<br/>10.2 Allocating A Passive TCP Socket 123<br/>10.3 A Server For The DAYTIME Service 124<br/>10.4 Process Structure 124<br/>10.5 An Example DAYTIME Server 125<br/>10.6 Closing Connections 128<br/>10.7 Connection Termination And Server Vulnerability 128<br/>10.8 Summary 129<br/>Chapter 11 Concurrent, Connection-Oriented Servers (TCP)<br/>77.7 Introduction 131<br/>77.2 Concurrent ECHO 131<br/>11.3 Iterative Vs. Concurrent Implementations 132<br/>11.4 Process Structure 132<br/>77.5 An Example Concurrent ECHO Server 133<br/>11.6 -Cleaning Up Errant Processes 137<br/>77.7 Summary 138<br/>Chapter 12 Single-Process, Concurrent Servers (TCP)<br/>72.7 Introduction 139<br/>72.2 Data-driven Processing In A Server 139<br/>12.3 Data-Driven Processing With A Single Process 140<br/>12.4 Process Structure Of A Single-Process Server 141<br/>12.5 An.Example Single-Process ECHO Server 142<br/>72.6 Summary 144<br/>Chapter 13 Multiprotocol Servers (TCP, UDP)<br/>75.7 Introduction 147<br/>13.2 The Motivation For Reducing The Number Of Servers 147<br/>13.3 Multiprotocol Server Design 148<br/>13.4 Process Structure 148<br/>13.5 An Example Multiprotocol DAYTIME Server 149<br/>13.6 The Concept Of Shared Code 153<br/>13.7 Concurrent Multiprotocol Servers 153<br/>13.8 Summary 153<br/>Chapter 14 Multiservice Servers (TCP, UDP)<br/>14.1 Introduction 155<br/>14.2 Consolidating Servers 155<br/>14.3 A Connectionless, Multiservice Server Design 156<br/>14.4 A Connection-Oriented, Multiservice Server Design 157<br/>14.5 A Concurrent, Connection-Oriented, Multiservice Server 158<br/>14.6 A Single-Process, Multiservice Server Implementation 158<br/>14.7 Invoking Separate Programs From A Multiservice Server 159<br/>14.8 Multiservice, Multiprotocol Designs 160<br/>14.9 An Example Multiservice Server 161<br/>14.10 Static and Dynamic Server Configuration 168<br/>14.11 The UNIX Super Server, Inetd 169<br/>14.12 An Example Inetd Server 171<br/>14.13 Summary 173<br/>Chapter 15 Uniform, Efficient Management Of Server Concurrency<br/>15.1 Introduction 175<br/>15.2 Choosing Between An Iterative And A Concurrent Design 175<br/>15.3 Level Of Concurrency 176<br/>15.4 Demand-Driven Concurrency 177<br/>15.5 The Cost Of Concurrency 177<br/>15.6 Overhead And Delay 177<br/>15.7 Small Delays Can Matter 178<br/>15.8 Process Preallocation 179<br/>15.8.1 Preallocation In UNIX 180<br/>15.8.2 Preallocation In A Connection-Oriented Server 180<br/>15.8.3 Preallocation In A Connectionless Server 181<br/>15.8.4 Preallocation, Bursty Traffic, And NFS 182<br/>15.8.5 Process Preallocatipn On A Multiprocessor 183<br/>15.9 Delayed Process Allocation 183<br/>15.10 The Uniform Basis For Both Techniques 184<br/>15.11 Combining Techniques 185<br/>15.12 Summary 185-<br/>Chapter 16 Concurrency in Clients<br/>16.1 Introduction 187<br/>16.2 The Advantages Of Concurrency 187<br/>16.3 The Motivation For Exercising Control 188<br/>16.4 Concurrent Contact With Multiple Servers 189<br/>16.5 Implementing Concurrent Clients 189<br/>16.6 Single-Process Implementations 191<br/>16.7 An Example Concurrent Client That Uses ECHO 192<br/>16.8- Execution Of The Concurrent Client 196<br/>16.9 Concurrency In The Example Code 197<br/>16.10 Summary 198<br/>Chapter 17 Tunneling At The Transport And Application Levels<br/>17.1 Introduction 199<br/>17.2 Multiprotocol Environments 199<br/>17.3 Mixing Network Technologies 201<br/>17.4 Dynamic Circuit Allocation 202<br/>17.5 Encapsulation And Tunneling 203<br/>-17.6 Tunneling Through An IP Internet 203<br/>17.7 Application-Level Tunneling Between Clients And Servers 204<br/>17.8 Tunneling, Encapsulation, And Dialup Phone Lines 205<br/>17.9 Summary 206<br/>Chapter 18 Application Level Gateways<br/>18.1 Introduction 209<br/>18.2 Clients And Servers In Constrained Environments 209<br/>18.2.1 The Reality Of Multiple Technologies 209<br/>18.2.2 Computers With Limited Functionality 210<br/>18.2.3 Connectivity Constraints That Arise From Security 210<br/>18.3 Using Application Gateways 211<br/>18.4 Interoperability Through A Mail Gateway 212<br/>18.5 Implementation Of A Mail Gateway 213<br/>18.6 A Comparison Of Application Gateways And Tunneling 213<br/>18.7 Application Gateways And Limited Functionality Systems 215<br/>18.8 Application Gateways Used For Security 216<br/>18.9 Application Gateways And The Extra Hop Problem 217<br/>18.10 An Example Application Gateway 219<br/>18.11 Implementation Of An Application Gateway 220<br/>18.12 Code For The Application Gateway 221<br/>18.13 An Example Gateway Exchange 223<br/>18.14 Using Rfcd With UNIX's.forward 223<br/>18.15 A General-Purpose Application Gateway 224<br/>18.16 Operation Of SLIRP 224<br/>18.17 How SURP Handles Connections 225<br/>18.18 IP Addressing And SURP 225<br/>18.19 Summary 226<br/>Chapter 19 External Data Representation (XDR)<br/>19.1 Introduction 229<br/>19.2 Representations For Data In Computers 229<br/>19.3 The N-Squared Conversion Problem 230<br/>19.4 Network Standard Byte Order 231<br/>19.5 A De Facto Standard External Data Representation 232<br/>19.6 XDR Data Types 233<br/>19.7, Implicit Types 234<br/>19.8 Software Support For Using XDR 234<br/>19.9 XDR Library Routines 234<br/>19.10 Building A Message One Piece At A Time 234<br/>19.11 Conversion Routines In The XDR Library 236<br/>19.12 XDR Streams, 1/0, and TCP 238<br/>19.13 Records, Record Boundaries, And Datagram 1/0 239<br/>19.14 Summary 239<br/>Chapter 20 Remote Procedure Call Concept (RPC)<br/>20.1 Introduction 241<br/>20.2 Remote Procedure Call Model 241<br/>20.3 Two Paradigms For Building Distributed Programs 242<br/>20.4 A Conceptual Model For Conventional Procedure Calls 243<br/>20.5 An Extension Of the Procedural Model 243<br/>20.6 Execution Of Conventional Procedure Call And Return<br/>20.7 The Procedural Model In Distributed Systems 245<br/>20.8 Analogy Between Client-Server And RPC 246<br/>20.9 Distributed Computation As A Program 247<br/>20.10 Sun Microsystems' Remote Procedure Call Definition<br/>20.11 Remote Programs And Procedures 248<br/>20.12 Reducing The Number Of Arguments 249<br/>20.13 Identifying Remote Programs And Procedures 249 .<br/>20.14 Accommodating Multiple Versions Of A Remote Program 250<br/>20.15 Mutual Exclusion For Procedures In A Remote Program 251<br/>20.16 Communication Semantics 252<br/>20.17 At Least Once Senumtics 252<br/>20.18 RPC Retransmission 253<br/>20.19 Mapping A Remote Program To A Protocol Port 253<br/>20.20 Dynamic Port Mapping 254<br/>20.21 RPC Port Mapper Algorithm 255<br/>20.22 ONC RPC Message Format 257<br/>20.23 Marshaling Arguments For A Remote Procedure 258<br/>20.24 Authentication 258<br/>20.25 An Example Of RPC Message Representation 259<br/>20.26 An Example Of The UNIX Authentication Field 260<br/>20.27 Summary 261<br/>244<br/>248<br/>Chapter 21 Distributed Program Generation (Rpcgen Concept)<br/>21.1 Introduction 265<br/>21.2 Using Remote Procedure Calls 266<br/>21.3 Programming Mechanisms To Support RPC 267<br/>21.4 Dividing A Program Into Local And Remote Procedures 268<br/>21.5 Adding Code For RPC 269<br/>21.6 Stub Procedures 269<br/>21.7 Multiple Remote Procedures And Dispatching 270<br/>21.8- Name Of The Client-Side Stub Procedure 271<br/>21.9 Using Rpcgen To Generate Distributed Programs 272<br/>21.10 Rpcgen Output And Interface Procedures 272<br/>21.11 Rpcgen Input And Output 273<br/>21.12 Using Rpcgen To Build A Client And Server 274<br/>21.13 Summary 274<br/>Chapter 22 Distributed Program Generation (Rpcgen Example)<br/>22.1 Introduction 277<br/>22.2 An Example To Illustrate Rpcgen 278<br/>22.3 Dictionary Look Up 278<br/>22.4 Eight Steps To A Distributed Application 279<br/>22.5 Step '1: Build A Conventional Application Program 280<br/>22.6 Step 2: Divide The Program Into Two Parts 284<br/>22.7 Step 3: Create An Rpcgen Specification 290<br/>22.8 Step 4: Run Rpcgen 292<br/>22.9 The .h File Produced By Rpcgen 292<br/>22.10 The XDR Conversion File Produced By Rpcgen 293<br/>22.11 The Client Code Produced By Rpcgen 294<br/>22.12 The Server Code Produced By Rpcgen 296<br/>22.13 Step 5: Write Stub Interface Procedures 299<br/>22.13.1 Client-Side Interface Routines 299<br/>22.13.2 Server-Side Interface Routines 301<br/>22.14 Step 6; Compile And Link The Client Program 303<br/>22.15 Step 7: Compile And Link The Server Program 307<br/>22.16 Step 8: Start The Server And Execute The Client 309<br/>,22.17 Using The UNIX Make Utility 309<br/>22.18 Summary 311<br/>Chapter 23 Network File System Concepts (NFS)<br/>23.1 Introduction 315<br/>23.2 Remote File Access Vs. Transfer 315<br/>23.3 Operations On Remote Files 316<br/>23.4 File Access Among Heterogeneous Computers 31.6<br/>23.5 Stateless Servers 317<br/>23.6 NFS And UNIX File Semantics 317<br/>23.7 Review Of The UNIX File System 317<br/>23.7.1 Basic Definitions 317<br/>23.7.2 A Byte Sequence Without Record Boundaries 318<br/>23.7.3 A File's Owner And Group Identifiers 318<br/>23.7.4 Protection And Access 318<br/>23.7.5 The Open-Read-Write-Close Paradigm 320<br/>23.7.6 Data Transfer 321<br/>23.7.7 Permission To Search A Directory 321<br/>23.7.8 Random Access 321<br/>23.7.9 Seeking Beyond The End Of File 322<br/>23.7.10 File Position And Concurrent Access 323<br/>23.7.11 Semantics Of Write During Concurrent Access 324<br/>23.7.12 File Names And Paths 324<br/>23.7.13 Inode: Information Stored With A File 325<br/>23.7.14 Stat Operation 326<br/>23.7:15 The File Naming Mechanism 327<br/>23.7.16 File System Mounts 328<br/>23.7.17 UNIX File Name Resolution 330<br/>23.7. IS Symbolic Links 331<br/>23.8 Files Under NFS 331<br/>23.9 NFS File Types 332<br/>23.10 NFS File Modes 332<br/>23.11 NFS File Attributes 333<br/>23.12 NFS Client And Server 334<br/>23.13 NFS Client Operation 335<br/>23.14 NFS Client And UNIX 336<br/>23.15 NFS Mounts 337<br/>23.16 File Handle 338<br/>23.17 Handles Replace Path Names 338<br/>23.18 An NFS Client In UNIX 340<br/>23.19 File Positioning With A Stateless Server 340<br/>23.20 Operations On Directories 341<br/>23.21 Reading A Directory Statelessly 341<br/>23.22 Multiple Hierarchies In An NFS Server 342<br/>23.23 The Mount Protocol 342<br/>23.24 Summary 343<br/>Chapter 24 Network File System Protocol (NFS, Mount)<br/>24.1 Introduction 345<br/>24.2 Using RFC To Define A Protocol 345<br/>24.3 Defining A Protocol With Data Structures And Procedures 346<br/>24.4 NFS Constant, Type, And Data Declarations 347<br/>24.4.1 NFS Constants 347<br/>24.4.2 NFS Typedef Declarations 348<br/>24.4.3 NFS Data Structures 348<br/>24.5 NFS Procedures 350<br/>24.6 Semantics Of NFS Operations 351<br/>24.6.1 NFSPROC_NULL (Procedure 0) 352<br/>24.6.2 NFSPROC_GETATTR (Procedure 1) 352<br/>24.6.3 NFSPROC_SETATTR (Procedure 2) 352<br/>24.6.4 NFSPROC_ROOT (Procedure 3) [Obsolete in NFS3] 352<br/>24.6.5 NFSPROC_LOOKUP (Procedure 4) 352<br/>24.6.6 NFSPR0C_READL1NK (Procedure 5) 352<br/>24.6.7 NFSPROC_READ (Procedure 6) 352<br/>24.6.8 NFSPR0C_WR1TECACHE (Procedure 7) [Obsolete in NFS3] 352<br/>24.6.9 NFSPROCJVRITE (Procedure 8) 353<br/>24.6.10 NFSPROCJCREATE (Procedure 9) 353<br/>24.6.11 NFSPROC_REMOVE (Procedure 10) 353<br/>24.6.12 NFSPROC_RENAME (Procedure 11) 353<br/>24.6.13 NFSPROC_UNK (Procedure 12) 353<br/>24.6.14 NFSPR0C_SYML1NK (Procedure 13) 353<br/>24.6.15 NFSPR0C_MKD1R (Procedure 14) 354<br/>24.6.16 NFSPR0C_RMD1R (Procedure 15) 354<br/>24.6.17 NFSPR0C_READD1R (Procedure 16) 354<br/>24.6.18 NFSPROC_STATFS (Procedure 17) 354<br/>24.7 The Mount Protocol 355<br/>24.7.1 Mount Constant Definitions 355<br/>24.7.2 Mount Type Definitions 355<br/>24.7.3 Mount Data Structures 356<br/>24.8 Procedures In The Mount Protocol 357<br/>24.9 Semantics of Mount Operations 357<br/>24.9.1 MNTPROC_NULL (Procedure 0) 357<br/>24.9.2 MNTPROC_MNT (Procedure 1) 357<br/>24.9.3 MNTPROC_DUMP (Procedure 2) 358<br/>24.9.4 MNTPROC_UMNT (Procedure 3) 358<br/>24.9.5 MNTPROCJJMNTALL (Procedure 4) 358<br/>24.9.6 MNTPR0C_EXP0RT (Procedure 5) 358<br/>24.10 NFS And Mount Authentication 358<br/>24.11 Changes In NFS Version 3 360<br/>24.12 Summary 361<br/>Chapter 25 A TELNET Client (Program Structure)<br/>25.1 Introduction 363<br/>25.2 Overview 364<br/>25.2.1 The User's Terminal 364<br/>25.2.2 Command Arul Control Information 364<br/>25.2.3 Terminals, Windows, and Files 364<br/>25.2.4 The Need For Concurrency 365<br/>25.2.5 A Process Model For A TELNET Client 366<br/>25.3 A TELNET Client Algorithm 366<br/>25.4 Terminal 1/0 In UNIX 367<br/>25.4.1 Controlling A Device Driver 368<br/>25.5 Establishing Terminal Modes 369<br/>25.6 Global Variable Used For Stored State 371<br/>25.7 Restoring Terminal Modes Before Exit 372<br/>25.8 Client Suspension And Resumption 373<br/>25.9 Finite State Machine Specification 374<br/>25.10 Embedding Commands In A TELNET Data Stream 375<br/>25.11 Option Negotiation 376<br/>25.12 Request/Offer Symmetry 376<br/>25.13 TELNET Character Definitions 376<br/>25.14 A Finite State Machine For Data From The Server 378<br/>25.15 Transitions Among States 379<br/>25.16 A Finite State Machine Implementation 381<br/>25.17 A Compact FSM Representation 381<br/>25.18 Keeping The Compact Representation At Run-Time 383<br/>25.19 Implementation Of A Compact Representation 383<br/>25.20 Building An FSM Transition Matrix 385<br/>25.21 The Socket Output Finite State Machine 387<br/>25.22 Definitions For The Socket Output FSM 390<br/>25.23 The Option Subnegotiation Finite State Machine 391<br/>25.24 Definitions For The Option Subnegotiation FSM 392<br/>25.25 FSM Initialization 393<br/>25.26 Arguments For The TELNET Client 394<br/>25.27 The Hfart Of The TELNET Client 395<br/>25.28 Implementation Of The Main FSM 399<br/>25.29 Surhmary 401<br/>Chapter 26 A TELNET Client (Implementation Details)<br/>26.1 Introduction 403<br/>26.2 The FSM Action Procedures 403<br/>26.3 Recording The Type Of An Option Request 404<br/>26.4 Performing No Operation 405<br/>26.5 Responding To WILL/WONT For The Echo Option 405<br/>26.6 Responding To WILL/WONT For Unsupported Options 407<br/>26.7 Responding To WILL/WONT For The No Go-Ahead Option 407<br/>26.8 Generating DO/DONT For Binary Transmission 409<br/>26.9 Responding To DO/DONT For Unsupported Options 410<br/>26.10- Responding To DO/DONT For Transmit Binary Option 410<br/>26.11 Responding To DO/DONT For The Terminal Type Option 412<br/>26.12 Option Subnegotiation 413<br/>26.13 Sending Terminal Type Information 414<br/>26.14 Terminating Subnegotiation 416<br/>26.15 Sending A Character To The Server 416<br/>26.16 Displaying Incoming Data On The User's Terminal 418<br/>26.17 Using Termcap To Control The User's Terminal 421<br/>26.18 Writing A Block Of Data To The Server 422<br/>26.19 Interacting With The Client Process 424<br/>26.20 Responding To Illegal Commands 424<br/>26.21 Scripting To A File 425<br/>26.22 Implementation Of Scripting 425<br/>26.23 Initialization Of Scripting 426<br/>26.24 Collecting Characters Of The Script File Name 427<br/>26.25 Opening A Script File 428<br/>26.26 Terminating Scripting 430<br/>26.27 Printing Status Information 431<br/>26.28 Summary 432<br/>Chapter 27 Practical Hints And Techniques For UNIX Servers<br/>27.7 Introduction 435<br/>27.2 Operating In Background 435<br/>27.3 Programming A Server To Operate In Background 436<br/>27.4 Open Descriptors And Inheritance 437<br/>27.5 Programming A Server To Close Inherited Descriptors 438<br/>27.6 Signals From The Controlling TTY 438<br/>27.7 Programming A Server To Change Its Controlling TTY 438<br/>27.8. Moving To A Safe And Known Directory 439<br/>27.9 Programming A Server To Change Directories 439<br/>27.10 The UNIX Umask 440<br/>27.11 Programming A Server To Set Its Umask 440<br/>27.72 Process Groups 440<br/>27.13 Programming A Server To Set Its Process Group 441<br/>27.14 Descriptors For Standard I/O 441<br/>27.15 Programming A Server To Open Standard Descriptors 441<br/>27.16 Mutual Exclusion For The Server 442<br/>27.17 Programming A Server To Avoid Multiple Copies 442<br/>27.18 Recording A Server's Process ID 443<br/>27.19 Programming A Server To Record Its Process ID 443<br/>27.20 Waiting For A Child Process To Exit 444<br/>27.21 Programming A Server To Wait For Each Child To Exit 444<br/>27.22 Extraneous Signals 444<br/>27.23 Programming A Server To Ignore Extraneous Signals 445<br/>27.24 Using A System Log Facility 445<br/>27.24.1 Generating Log Messages 445<br/>27.24.2 The Advantage Of Indirection And Standard Error 445<br/>27.24.3 Limitations Of 1/0 Redirection 446<br/>27.24.4 A Client-Server Solution 446<br/>27.24.5 The Syslog Mechanism 447<br/>27.24.6 Syslog Message Classes 447<br/>27.24.7 Syslog Facilities 447<br/>27.24.8 Syslog Priority Levels 448<br/>27.24.9 Using Syslog 448<br/>27.24.10An Example Syslog Configuration File 449<br/>27.25 Summary 450<br/>Chapter 28 Deadlock And Starvation In Client-Server Systems<br/>• 28.1 Introduction 453<br/>28.2 Definition Of Deadlock 454<br/>28.3 Difficulty Of Deadlock Detection 454<br/>28.4 Deadlock Avoidance 455<br/>28.5 Deadlock Between A Client And Server 455<br/>28.6 Avoiding Deadlock In A Single Interaction 456<br/>28.7 Starvation Among A Set Of Clients And A Server 456<br/>28.8 Busy Connections And Starvation 457<br/>25.9 Avoiding Blocking Operations 458<br/>28.10 Processes, Connections, And Other Limits 458<br/>28.11 Cycles Of Clients And Servers 459<br/>28.12 Documenting Dependencies 459<br/>28.13 Summary 460 |