/[shmookey]/dispense2/disserv/DispenseServer.py


UCC Code Repository

Contents of /dispense2/disserv/DispenseServer.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11 - (show annotations) (download) (as text)
Thu Nov 1 12:06:57 2007 UTC (14 years, 1 month ago) by shmookey
File MIME type: text/x-python
File size: 517 byte(s)
fix filenames

1 from twisted.internet.protocol import Protocol, Factory
2 from twisted.internet import reactor
3
4 import Config
5 from RequestBuilder import Welcome
6 from RequestParser import ParseRequest
7
8 class DispenseServer (Protocol):
9 def connectionMade (self):
10 self.transport.write (Welcome (Config.welcomeMessage))
11 def dataReceived (self, data):
12 req = ParseRequest (data)
13 if req.type == E_INVALID
14 self.transport.write (data)
15
16 def DispenseFactory ():
17 factory = Factory ()
18 factory.protocol = DispenseServer
19 return factory

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26