Foreword to the First Edition |
|
ix | |
Preface |
|
xiii | |
|
Part I An Introduction to Twisted |
|
|
|
|
3 | (8) |
|
|
3 | (2) |
|
|
3 | (1) |
|
|
4 | (1) |
|
|
5 | (1) |
|
|
5 | (2) |
|
|
5 | (1) |
|
Installing Twisted from a Release Tarball |
|
|
6 | (1) |
|
Installing Twisted from a Source Checkout |
|
|
6 | (1) |
|
Installing Optional Dependencies from Source |
|
|
6 | (1) |
|
Testing Your Installation |
|
|
7 | (1) |
|
Using the Twisted Documentation |
|
|
8 | (1) |
|
|
8 | (1) |
|
|
8 | (1) |
|
Finding Answers to Your Questions |
|
|
9 | (2) |
|
|
9 | (1) |
|
|
9 | (1) |
|
|
9 | (1) |
|
|
9 | (2) |
|
2 Building Basic Clients and Servers |
|
|
11 | (14) |
|
A TCP Echo Server and Client |
|
|
11 | (1) |
|
|
12 | (2) |
|
|
14 | (1) |
|
|
14 | (1) |
|
|
15 | (1) |
|
|
16 | (1) |
|
Decoupling Transports and Protocols |
|
|
16 | (1) |
|
A TCP Quote Server and Client |
|
|
16 | (3) |
|
|
19 | (3) |
|
More Practice and Next Steps |
|
|
22 | (3) |
|
3 Writing Asynchronous Code with Deferreds |
|
|
25 | (14) |
|
What Deferreds Do and Don't Do |
|
|
25 | (1) |
|
The Structure of a Deferred Object |
|
|
26 | (2) |
|
Callback Chains and Using Deferreds in the Reactor |
|
|
28 | (2) |
|
Practice: What Do These Deferred Chains Do? |
|
|
30 | (3) |
|
|
31 | (1) |
|
|
31 | (1) |
|
|
31 | (1) |
|
|
32 | (1) |
|
|
32 | (1) |
|
|
33 | (1) |
|
The Truth About addCallbacks |
|
|
33 | (2) |
|
|
34 | (1) |
|
|
35 | (1) |
|
Key Facts About Deferreds |
|
|
35 | (1) |
|
Summary of the Deferred API |
|
|
36 | (1) |
|
More Practice and Next Steps |
|
|
36 | (3) |
|
|
39 | (14) |
|
Responding to HTTP Requests: A Low-Level Review |
|
|
39 | (4) |
|
The Structure of an HTTP Request |
|
|
40 | (2) |
|
|
42 | (1) |
|
|
43 | (5) |
|
|
43 | (2) |
|
|
45 | (1) |
|
|
46 | (2) |
|
|
48 | (1) |
|
|
48 | (1) |
|
|
49 | (2) |
|
More Practice and Next Steps |
|
|
51 | (2) |
|
|
53 | (10) |
|
Basic HTTP Resource Retrieval |
|
|
53 | (2) |
|
|
53 | (1) |
|
Downloading a Web Resource |
|
|
54 | (1) |
|
|
55 | (5) |
|
Requesting Resources with Agent |
|
|
55 | (2) |
|
Retrieving Response Metadata |
|
|
57 | (1) |
|
|
58 | (2) |
|
More Practice and Next Steps |
|
|
60 | (3) |
|
Part II Building Production-Grade Twisted Services |
|
|
|
6 Deploying Twisted Applications |
|
|
63 | (8) |
|
The Twisted Application Infrastructure |
|
|
63 | (5) |
|
|
64 | (1) |
|
|
64 | (1) |
|
|
64 | (1) |
|
|
65 | (1) |
|
|
66 | (2) |
|
|
68 | (1) |
|
More Practice and Next Steps |
|
|
68 | (3) |
|
|
69 | (2) |
|
|
71 | (6) |
|
Basic In-Application Logging |
|
|
71 | (2) |
|
|
73 | (1) |
|
|
73 | (2) |
|
Key Facts and Caveats About Logging |
|
|
75 | (2) |
|
|
77 | (4) |
|
Nonblocking Database Queries |
|
|
77 | (3) |
|
More Practice and Next Steps |
|
|
80 | (1) |
|
|
81 | (12) |
|
The Components of Twisted Cred |
|
|
81 | (1) |
|
|
82 | (4) |
|
|
86 | (3) |
|
Authentication in Twisted Applications |
|
|
89 | (2) |
|
More Practice and Next Steps |
|
|
91 | (2) |
|
10 Threads and Subprocesses |
|
|
93 | (10) |
|
|
93 | (3) |
|
|
96 | (4) |
|
Running a Subprocess and Getting the Result |
|
|
96 | (1) |
|
|
97 | (3) |
|
More Practice and Next Steps |
|
|
100 | (3) |
|
|
103 | (16) |
|
Writing and Running Twisted Unit Tests with Trial |
|
|
103 | (1) |
|
|
104 | (4) |
|
|
108 | (7) |
|
|
109 | (3) |
|
Testing the Passage of Time |
|
|
112 | (3) |
|
More Practice and Next Steps |
|
|
115 | (4) |
|
Part III More Protocols and More Practice |
|
|
|
|
119 | (6) |
|
|
119 | (2) |
|
|
121 | (3) |
|
More Practice and Next Steps |
|
|
124 | (1) |
|
|
125 | (20) |
|
|
126 | (6) |
|
|
126 | (1) |
|
Sending Emails Using SMTP |
|
|
127 | (1) |
|
|
128 | (2) |
|
|
130 | (2) |
|
|
132 | (7) |
|
|
133 | (4) |
|
|
137 | (2) |
|
|
139 | (4) |
|
|
139 | (4) |
|
More Practice and Next Steps |
|
|
143 | (2) |
|
|
145 | (16) |
|
|
145 | (6) |
|
|
145 | (6) |
|
Using Public Keys for Authentication |
|
|
151 | (2) |
|
Providing an Administrative Python Shell |
|
|
153 | (3) |
|
Running Commands on a Remote Server |
|
|
156 | (3) |
|
|
156 | (3) |
|
More Practice and Next Steps |
|
|
159 | (2) |
|
|
161 | |