售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Boost.Asio C++ Network Programming Cookbook
Table of Contents
Boost.Asio C++ Network Programming Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. The Basics
Introduction
Creating an endpoint
Getting ready
How to do it…
Creating an endpoint in the client to designate the server
Creating the server endpoint
How it works…
There's more...
See also
Creating an active socket
How to do it...
How it works...
There's more...
See also
Creating a passive socket
How to do it…
How it works…
See also
Resolving a DNS name
How to do it…
How it works…
There's more…
See also
Binding a socket to an endpoint
How to do it…
How it works…
There's more…
See also
Connecting a socket
How to do it…
How it works…
There's more…
See also
Accepting connections
How to do it…
How it works…
See also
2. I/O Operations
Introduction
I/O buffers
Synchronous and asynchronous I/O operations
Additional operations
Using fixed length I/O buffers
How to do it…
Preparing a buffer for an output operation
Preparing a buffer for an input operation
How it works…
Preparing a buffer for an output operation
Preparing a buffer for an input operation
See also
Using extensible stream-oriented I/O buffers
How to do it…
How it works…
See also
Writing to a TCP socket synchronously
How to do it…
How it works…
Alternative – the send() method
There's more...
See also
Reading from a TCP socket synchronously
How to do it…
How it works…
Alternative – the receive() method
There's more...
The asio::read() function
The asio::read_until() function
The asio::read_at() function
See also
Writing to a TCP socket asynchronously
How to do it…
How it works…
There's more...
See also
Reading from a TCP socket asynchronously
How to do it…
How it works…
There's more...
See also
Canceling asynchronous operations
How to do it…
How it works…
There's more...
See also
Shutting down and closing a socket
How to do it…
The client application
The server application
Closing a socket
How it works…
See also
3. Implementing Client Applications
Introduction
The classification of client applications
Synchronous versus asynchronous
The sample protocol
Implementing a synchronous TCP client
How to do it…
How it works…
The SyncTCPClient class
The main() entry point function
See also
Implementing a synchronous UDP client
How to do it…
How it works…
The SyncUDPClient class
The main() entry point function
See also
Implementing an asynchronous TCP client
How to do it…
How it works…
Starting the application – the main() entry point function
Request completion – the handler() callback function
The AsyncTCPClient class – initializing
The AsyncTCPClient class – initiating a request
The AsyncTCPClient class – canceling the request
The AsyncTCPClient class – closing the client
There's more…
Implementing a multithreaded TCP client application
See also
4. Implementing Server Applications
Introduction
The sample protocol
Implementing a synchronous iterative TCP server
How to do it…
How it works…
The Service class
The Acceptor class
The Server class
The main() entry point function
Eliminating the drawbacks
Stopping a server in reasonable amount of time
Dealing with the server's vulnerability
Analyzing the results
See also
Implementing a synchronous parallel TCP server
How to do it…
How it works…
The Service class
The Acceptor class
The Server class
The main() entry point function
Eliminating the drawbacks
See also
Implementing an asynchronous TCP server
How to do it…
How it works…
The Service class
The Acceptor class
The Server class
The main() entry point function
See also
5. HTTP and SSL/TLS
Introduction
Implementing the HTTP client application
How to do it…
The HTTPResponse class
The HTTPRequest class
The HTTPClient class
The callback and the main() entry point function
How it works…
The HTTPClient class
The HTTPRequest class
The HTTPResponse class
Callback and the main() entry point functions
See also
Implementing the HTTP server application
Getting ready…
How to do it…
How it works…
See also
Adding SSL/TLS support to client applications
Getting ready…
How to do it…
How it works…
The SyncSSLClient class
The main() entry point function
See also
Adding SSL/TLS support to server applications
Getting ready…
How to do it…
How it works…
The Service class
The Acceptor class
See also
6. Other Topics
Introduction
Using composite buffers for scatter/gather operations
Getting ready…
How to do it…
Preparing a composite buffer for gather output operations
Preparing a composite buffer for an input operation
How it works…
See also
Using timers
How to do it…
How it works…
Getting and setting socket options
Getting ready…
How to do it…
How it works…
Performing a stream-based I/O
How to do it…
How it works…
There's more…
Implementing a server-side I/O
Setting timeout intervals
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜