Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from twisted.internet import protocol, reactor
- from twisted.protocols import basic
- class FingerProtocol(basic.LineReceiver):
- def lineReceived(self, user):
- self.transport.write(self.factory.getUser(user)+"\r\n")
- self.transport.loseConnection()
- class FingerFactory(protocol.ServerFactory):
- protocol = FingerProtocol
- def getUser(self, user):
- return "This is response"
- reactor.listenTCP(10000, FingerFactory())
- reactor.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement