| 1 |
|
| 2 |
:LastChangedDate: $LastChangedDate$ |
| 3 |
:LastChangedRevision: $LastChangedRevision$ |
| 4 |
:LastChangedBy: $LastChangedBy$ |
| 5 |
|
| 6 |
Examples |
| 7 |
======== |
| 8 |
|
| 9 |
Simple Echo server and client |
| 10 |
----------------------------- |
| 11 |
|
| 12 |
- :download:`simpleclient.py` - simple TCP client |
| 13 |
- :download:`simpleserv.py` - simple TCP echo server |
| 14 |
|
| 15 |
|
| 16 |
Chat |
| 17 |
---- |
| 18 |
|
| 19 |
- :download:`chatserver.py` - shows how to communicate between clients |
| 20 |
|
| 21 |
|
| 22 |
Echo server & client variants |
| 23 |
----------------------------- |
| 24 |
|
| 25 |
- :download:`echoserv.py` - variant on a simple TCP echo server |
| 26 |
- :download:`echoclient.py` - variant on a simple TCP client |
| 27 |
- :download:`echoserv_udp.py` - simplest possible UDP server |
| 28 |
- :download:`echoclient_udp.py` - simple UDP client |
| 29 |
- :download:`echoserv_ssl.py` - simple SSL server |
| 30 |
- :download:`echoclient_ssl.py` - simple SSL client |
| 31 |
|
| 32 |
|
| 33 |
AMP server & client variants |
| 34 |
---------------------------- |
| 35 |
|
| 36 |
- :download:`ampserver.py` - do math using AMP |
| 37 |
- :download:`ampclient.py` - do math using AMP |
| 38 |
|
| 39 |
|
| 40 |
Perspective Broker |
| 41 |
------------------ |
| 42 |
|
| 43 |
- :download:`pbsimple.py` - simplest possible PB server |
| 44 |
- :download:`pbsimpleclient.py` - simplest possible PB client |
| 45 |
- :download:`pbbenchclient.py` - benchmarking client |
| 46 |
- :download:`pbbenchserver.py` - benchmarking server |
| 47 |
- :download:`pbecho.py` - echo server that uses login |
| 48 |
- :download:`pbechoclient.py` - echo client using login |
| 49 |
- :download:`pb_exceptions.py` - example of exceptions over PB |
| 50 |
- :download:`pbgtk2.py` - example of using GTK2 with PB |
| 51 |
- :download:`pbinterop.py` - shows off various types supported by PB |
| 52 |
- :download:`bananabench.py` - benchmark for banana |
| 53 |
|
| 54 |
|
| 55 |
Cred |
| 56 |
---- |
| 57 |
|
| 58 |
- :download:`cred.py` - Authenticate a user with an in-memory username/password database |
| 59 |
- :download:`dbcred.py` - Using a database backend to authenticate a user |
| 60 |
|
| 61 |
|
| 62 |
GUI |
| 63 |
--- |
| 64 |
|
| 65 |
- :download:`wxdemo.py` - demo of wxPython integration with Twisted |
| 66 |
- :download:`pbgtk2.py` - example of using GTK2 with PB |
| 67 |
- :download:`pyuidemo.py` - PyUI |
| 68 |
|
| 69 |
|
| 70 |
FTP examples |
| 71 |
------------ |
| 72 |
|
| 73 |
- :download:`ftpclient.py` - example of using the FTP client |
| 74 |
- :download:`ftpserver.py` - create an FTP server which serves files for anonymous users from the working directory and serves files for authenticated users from ``/home``. |
| 75 |
|
| 76 |
|
| 77 |
Logging |
| 78 |
------- |
| 79 |
|
| 80 |
- :download:`twistd-logging.tac` - logging example using ILogObserver |
| 81 |
- :download:`testlogging.py` - use twisted.python.log to log errors to standard out |
| 82 |
- :download:`rotatinglog.py` - example of log file rotation |
| 83 |
|
| 84 |
|
| 85 |
POSIX Specific Tricks |
| 86 |
--------------------- |
| 87 |
|
| 88 |
- :download:`sendfd.py`, :download:`recvfd.py` - send and receive file descriptors over UNIX domain sockets |
| 89 |
|
| 90 |
|
| 91 |
Miscellaneous |
| 92 |
------------- |
| 93 |
|
| 94 |
- :download:`shaper.py` - example of rate-limiting your web server |
| 95 |
- :download:`stdiodemo.py` - example using stdio, Deferreds, LineReceiver and twisted.web.client. |
| 96 |
- :download:`ptyserv.py` - serve shells in pseudo-terminals over TCP |
| 97 |
- :download:`courier.py` - example of interfacing to Courier's mail filter interface |
| 98 |
- :download:`longex.py` - example of doing arbitrarily long calculations nicely in Twisted |
| 99 |
- :download:`longex2.py` - using generators to do long calculations |
| 100 |
- :download:`stdin.py` - reading a line at a time from standard input without blocking the reactor |
| 101 |
- :download:`streaming.py` - example of a push producer/consumer system |
| 102 |
- :download:`filewatch.py` - write the content of a file to standard out one line at a time |
| 103 |
- :download:`shoutcast.py` - example Shoutcast client |
| 104 |
- :download:`wxacceptance.py` - acceptance tests for wxreactor |
| 105 |
- :download:`postfix.py` - test application for PostfixTCPMapServer |
| 106 |
- :download:`udpbroadcast.py` - broadcasting using UDP |
| 107 |
- :download:`tls_alpn_client.py` - example of TLS next-protocol negotiation on the client side using ALPN. |
| 108 |
- :download:`tls_alpn_server.py` - example of TLS next-protocol negotiation on the server side using ALPN. |