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


UCC Code Repository

Contents of /dispense2/disserv/DispenseServer.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 14 - (hide annotations) (download) (as text)
Fri Nov 2 14:47:27 2007 UTC (13 years, 10 months ago) by shmookey
File MIME type: text/x-python
File size: 518 byte(s)
commit this!

1 shmookey 9 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 shmookey 14 #if req.type == E_INVALID
14 shmookey 9 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