3 ms·
Echo Server in Twisted Matrix: from twisted.internet import protocol, reactor class Echo(protocol.Protocol): def dataReceived(self, data):
by acangiano 17y ago
Echo Server in Twisted Matrix:
from twisted.internet import protocol, reactor
class Echo(protocol.Protocol):
def dataReceived(self, data):
self.transport.write(data)
if __name__ == '__main__':
factory = protocol.ServerFactory()
factory.protocol = Echo
reactor.listenTCP(8000,factory)
reactor.run()
- clemesha 17y agoExactly, thanks for posting this (you beat me to it). It's not that we need to constantly respond to every Tornado post with a Twisted rebuttal - but it is appropriate to respond to articles the contain FUD and demonstrate far less elegant, far more verbose, non cross-platform solutions.
- deleted 17y ago[deleted]
- tzury 17y agoYet, it is just nice seeing how tornado can be re-used outside the core web development.