Twisted

Twisted is an event-driven networking engine written in Python and licensed under the open source MIT license.

Install from source

Test installation

Slackbuild

Slackware64 14: python-twisted-13.2.0-x86_64-1_SBo.tgz

Echo server

   1 from twisted.internet import protocol, reactor
   2 
   3 class Echo(protocol.Protocol):
   4     def dataReceived(self, data):
   5         self.transport.write(data)
   6 
   7 class EchoFactory(protocol.Factory):
   8     def buildProtocol(self, addr):
   9         return Echo()
  10 
  11 reactor.listenTCP(1234, EchoFactory())
  12 reactor.run()

Python/Twisted (last edited 2014-09-26 22:05:54 by 33)