~justin-fathomdb/nova/justinsb-openstack-api-volumes

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/doc/core/howto/tutorial/listings/finger/finger05.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from twisted.internet import protocol, reactor
 
2
from twisted.protocols import basic
 
3
 
 
4
class FingerProtocol(basic.LineReceiver):
 
5
    def lineReceived(self, user):
 
6
        self.transport.write("No such user\r\n")
 
7
        self.transport.loseConnection()
 
8
 
 
9
class FingerFactory(protocol.ServerFactory):
 
10
    protocol = FingerProtocol
 
11
 
 
12
reactor.listenTCP(1079, FingerFactory())
 
13
reactor.run()