[Twisted network programming essential translation] Chapter 0th

Source: Internet
Author: User
Tags imap network function nntp nntp server ssh server
0.1 why twisted?

If you are not prepared to use twisted, you may have many objections. Why use twisted instead of other network function libraries or frameworks? The following are some good reasons:
· Python-based
Twisted is a strong object-oriented explanatory language written in Python. Python has filled its fans with enthusiasm. Programming with python is a pleasure, easy to write, easy to read, and easy to run. (By gashero) Because python is cross-platform, you can run the twisted program on Linux, windows, UNIX, Mac, and other systems.
· Asynchronous and event-driven
Synchronizing the network programming function library leaves developers with a painful choice: either to allow programs to lose response during network communication, or to introduce very complex threads. Twisted is event-based. The Asynchronous Network communication framework allows programs to be written to maintain a corresponding state when handling events, but does not need to use threads.
· Multiple Functions
Twisted includes a large number of features. Email, web, news, chat, DNS, ssh, telnet, RPC, database access, or more. All are ready for you.
· Flexibility
Twisted provides high-level classes that allow quick start. And are not restricted. You can also use advanced functions or custom network protocols. You can implement your own network protocol to control every byte.
· Open source code
Twisted is free of charge. It contains the source code and is released according to the function library protocol. You are also welcome to use twisted in your program. You do not have to pay any fees or worry about legal issues. If you want to know the operating principle of an object, you can directly look at the source code. If you have developed your own new features and extensions, please share them with us.
· Community Support
Twisted has an active community that includes developers and users. If you find the problem, you can also find many developers on the mail list to help you. View the FAQ section in Chapter 1. Or you can access the IRC channel # twisted to communicate with developers online.
· Platforms that are easy to integrate
A twisted program can share data among multiple services and integrate a lot of work. For example, you can write a proxy for SMTP to XMLRPC, a service that updates the website through SSH, or a Web Discussion group that contains the NNTP interface. To exchange data between platforms, twisted is a good choice. : If expand ("%") = "" | browse confirm w | else | confirm w | endif

----------------------------------------------

Contents of the 0.2 book

This book does not explain every class in the twisted framework, but focuses on more real examples. This book will also help you understand the key technologies and design patterns used in twisted. The following is a list of main contents:
· Install twisted
The first chapter explains how to download and install the platform-Related Extension libraries.
· Use TCP Connection
Chapter 2 shows you how to use twisted to establish TCP connections, including servers and clients.
· Web client and server
Chapter 3 and Chapter 4 explain how to use twisted to work on the web. Chapter 3 simulate a Web Client. In chapter 4, an example HTTP server is compiled to implement basic level management and response functions.

· Web Services and RPC
Twisted provides built-in support for multiple web services and remote call methods. (By gashero) Chapter 5 explains how to create an application in a rest architecture. It also explains how to write XMLRPC and soap clients and servers, and how to convert Python objects to network connections.
· Certification
Managing Users and authentication permissions is one of the core functions of many programs. Chapter 6 discusses implementation methods and provides a framework with good portability in a variety of applications.
· Email client and server
Chapter 7 and chapter 8 provide email support. The example in Chapter 7 shows how to write SMTP, POP3, and IMAP clients to send and receive emails. Chapter 8 shows how to build SMTP, POP3, and IMAP servers.
· USENET newsgroup
Chapter 9 discusses Usenet clients and servers using the NNTP protocol. (By gashero) and demonstrate how to read and send messages, how to run the NNTP server, and how to use NNTP as interfaces of other methods, such as RSS.
· SSH client and server
Chapter 10 explains SSH support. This section describes how to write an SSH server program and provides a remote Python interpreter. This chapter also shows how to write an SSH client to execute remote commands.
· Run and manage the twisted Program
Chapter 2 shows how to use the twisted tool to run and manage applications, such as backend genie threads, using setuid and chroot to restrict permissions, and writing log files.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.