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

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-02-26 16:24:15 by bl7-65-145)