Table of Contents
Preface iii
Chapter 1:
The Basics 1
Introduction 1
Creating an endpoint 5
Creating an active socket 12
Creating a passive socket 17
Resolving a DNS name 19
Binding a socket to an endpoint 25
Connecting a socket 29
Accepting connections 34
Chapter 2:
I/O Operations 39
Introduction 39
Using fixed length I/O buffers 41
Using extensible stream-oriented I/O buffers 47
Writing to a TCP socket synchronously 49
Reading from a TCP socket synchronously 55
Writing to a TCP socket asynchronously 62
Reading from a TCP socket asynchronously 71
Canceling asynchronous operations 80
Shutting down and closing a socket 86
Chapter 3:
Implementing Client Applications 95
Introduction 95
Implementing a synchronous TCP client 100
Implementing a synchronous UDP client 105
Implementing an asynchronous TCP client 110
Chapter 4:
Implementing Server Applications 127
Introduction 127
Implementing a synchronous iterative TCP server 131
Implementing a synchronous parallel TCP server 139
Implementing an asynchronous TCP server 147
Chapter 5:
HTTP and SSL/TLS 159
Introduction 159
Implementing the HTTP client application 161
Implementing the HTTP server application 184
Adding SSL/TLS support to client applications 196
Adding SSL/TLS support to server applications 202
Chapter 6:
Other Topics 211
Introduction 211
Using composite buffers for scatter/gather operations 212
Using timers 216 Getting and setting socket options 221
Performing a stream-based I/O 223
猜您喜欢
评论