Initial import to Tizen
[profile/ivi/python-twisted.git] / doc / core / howto / listings / pb / pb1server.py
1 #!/usr/bin/env python
2
3 # Copyright (c) Twisted Matrix Laboratories.
4 # See LICENSE for details.
5
6 from twisted.spread import pb
7
8 class Two(pb.Referenceable):
9     def remote_three(self, arg):
10         print "Two.three was given", arg
11         
12 class One(pb.Root):
13     def remote_getTwo(self):
14         two = Two()
15         print "returning a Two called", two
16         return two
17
18 from twisted.internet import reactor
19 reactor.listenTCP(8800, pb.PBServerFactory(One()))
20 reactor.run()