Twisted Network Programming Essentials

Af Jessica McKellar, Abe Fettig
Detaljer 2. Udgave O'Reilly Media, Incorporated
ISBN 9781449326111
Sprog Engelsk
Vælg mellem
Pris 337,00 kr.
Paperback

Ikke på lager

Ikke på lager. Bestil nu og få den leveret om ca. 12 hverdage

Get started with Twisted, the event-driven networking framework written in Python. With this introductory guide, you'll learn the key concepts and design patterns to build event-driven client and server applications for many popular networking protocols. You'll also learn the tools to build new protocols using Twisted's primitives.

Start by building basic TCP clients and servers, and then focus on deploying production-grade applications with the Twisted Application infrastructure. Along the way, you can play with and extend examples of common tasks you'll face when building network applications. If you're familiar with Python, you're ready for Twisted.

  • Learn the core components of Twisted servers and clients
  • Write asynchronous code with the Deferred API
  • Construct HTTP servers with Twisted's high-level web APIs
  • Use the Agent API to develop flexible web clients
  • Configure and deploy Twisted services in a robust and standardized fashion
  • Access databases using Twisted's nonblocking interface
  • Add common server components: logging, authentication, threads and processes, and testing
  • Explore ways to build clients and servers for IRC, popular mail protocols, and SSH

Foreword to the First Edition;Preface; Why Use Twisted?; What This Book Covers; Conventions Used in This Book; What You'll Need; Changes Since the Previous Edition; Using Code Examples; Safari® Books Online; How to Contact Us; Acknowledgments;An Introduction to Twisted;
Chapter 1: Getting Started;
1.1 Installing Twisted;
1.2 Installing from Source;
1.3 Testing Your Installation;
1.4 Using the Twisted Documentation;
1.5 Finding Answers to Your Questions;
Chapter 2: Building Basic Clients and Servers;
2.1 A TCP Echo Server and Client;
2.2 Event-Driven Programming;
2.3 The Reactor;
2.4 Transports;
2.5 Protocols;
2.6 A TCP Quote Server and Client;
2.7 Protocol State Machines;
2.8 More Practice and Next Steps;
Chapter 3: Writing Asynchronous Code with Deferreds;
3.1 What Deferreds Do and Don't Do;
3.2 The Structure of a Deferred Object;
3.3 Callback Chains and Using Deferreds in the Reactor;
3.4 Practice: What Do These Deferred Chains Do?;
3.5 The Truth About addCallbacks;
3.6 Key Facts About Deferreds;
3.7 Summary of the Deferred API;
3.8 More Practice and Next Steps;
Chapter 4: Web Servers;
4.1 Responding to HTTP Requests: A Low-Level Review;
4.2 Handling GET Requests;
4.3 Handling POST Requests;
4.4 Asynchronous Responses;
4.5 More Practice and Next Steps;
Chapter 5: Web Clients;
5.1 Basic HTTP Resource Retrieval;
5.2 Agent;
5.3 More Practice and Next Steps;Building Production-Grade Twisted Services;
Chapter 6: Deploying Twisted Applications;
6.1 The Twisted Application Infrastructure;
6.2 More twistd Examples;
6.3 More Practice and Next Steps;
Chapter 7: Logging;
7.1 Basic In-Application Logging;
7.2 twistd Logging;
7.3 Custom Loggers;
7.4 Key Facts and Caveats About Logging;
Chapter 8: Databases;
8.1 Nonblocking Database Queries;
8.2 More Practice and Next Steps;
Chapter 9: Authentication;
9.1 The Components of Twisted Cred;
9.2 Twisted Cred: An Example;
9.3 Credentials Checkers;
9.4 Authentication in Twisted Applications;
9.5 More Practice and Next Steps;
Chapter 10: Threads and Subprocesses;
10.1 Threads;
10.2 Subprocesses;
10.3 More Practice and Next Steps;
Chapter 11: Testing;
11.1 Writing and Running Twisted Unit Tests with Trial;
11.2 Testing Protocols;
11.3 Tests and the Reactor;
11.4 More Practice and Next Steps;More Protocols and More Practice;
Chapter 12: Twisted Words;
12.1 IRC Clients;
12.2 IRC Servers;
12.3 More Practice and Next Steps;
Chapter 13: Twisted Mail;
13.1 SMTP Clients and Servers;
13.2 IMAP Clients and Servers;
13.3 POP3 Clients and Servers;
13.4 More Practice and Next Steps;
Chapter 14: SSH;
14.1 SSH Servers;
14.2 Using Public Keys for Authentication;
14.3 Providing an Administrative Python Shell;
14.4 Running Commands on a Remote Server;
14.5 More Practice and Next Steps;
Chapter 15: The End;
15.1 Contributing to Twisted;Colophon;