Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > efe60a74a55b1603654f3f258ba7199d > files > 2740

python3-twisted-19.2.1-1.1.mga7.armv7hl.rpm


# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.

from __future__ import print_function

from twisted.spread import pb
from twisted.internet import reactor

class Echoer(pb.Root):
    def remote_echo(self, st):
        print('echoing:', st)
        return st

if __name__ == '__main__':
    reactor.listenTCP(8789, pb.PBServerFactory(Echoer()))
    reactor.run()