Initial import to Tizen
[profile/ivi/python-twisted.git] / doc / historic / 2003 / pycon / pb / pb-server1.py
1 #! /usr/bin/python
2
3 from twisted.spread import pb
4 import twisted.internet.app
5         
6 class ServerObject(pb.Root):
7     def remote_add(self, one, two):
8         answer = one + two
9         print "returning result:", answer
10         return answer
11     def remote_subtract(self, one, two):
12         return one - two
13     
14 app = twisted.internet.app.Application("server1")
15 app.listenTCP(8800, pb.BrokerFactory(ServerObject()))
16 app.run(save=0)