TwistedPeak |
UserPreferences |
The PEAK Developers' Center | FrontPage | RecentChanges | TitleIndex | WordIndex | SiteNavigation | HelpContents |
1. run-tp This script will call the peak script (installed when you installed the peak distribution), and it in turn will call the twistedpeak.echoserver:?EchoRunner class. This will start an ?EchoServer listening on port 8090 which will just echo back what you send it. Once you've started this script, test it by running:
telnet localhost 80902. run-tp2 This script will call the peak script (installed when you installed the peak distribution), and it in turn will call the twistedpeak.echoserver2:?Echo2Runner class. This will start an ?EchoServer listening on port 8091 which will just echo back what you send it, prepended with: you said: This example is slightly more complicated, as it uses PEAK's logging system to log what the client sends to it. Once you've started this script, test it by running:
telnet localhost 80913. run-tp-schema This script kicks off quite a lot. First of all it will utilize the PEAK's ZConfig and .ini machinery. See files tp.zcfg, and tp.ini for more details. Essentially, the tp.ini defines the logging that the Echo2 server uses. By default, it will log all client connections to the file logs/echoserver.log. You can change it to log to stderr by editing the file (there are comments how to do this in the file). The tp.zcfg file is more complicated. You may want to familiarize yourself with the ZConfig machinery first. Here's a good Start. If you go to the file tp.zcfg, you will see sections for ?EchoRunner and ?EchoRunner2. For ?EchoRunner, you can configure the port it listens on, and for ?EchoRunner2 you can configure the port it listens on, and the text it prepends to replies. You will also want to examine to files src/twistedpeak?/EchoSchema.xml, and src/twistedpeak/component.xml. These files define the configuration schema used in tp.zcfg. Don't worry if you find this confusing! I did too. Just read the ZConfig tutorial, read, and re-read the tp.zcfg and schema files until you see their connections. If you're still stuck, post to the list. Once you've started this script, test it by running:
telnet localhost 8080and:
telnet localhost 8081