summaryrefslogtreecommitdiff
path: root/py/demo/Ice/throughput/Server.py
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-09-14 06:26:31 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-09-14 06:26:31 +0000
commit502335f0e2d6d407b8c93690bd01d35c33e1f0cf (patch)
tree38f5b655a2a2411537b9361153d0b81f7f672325 /py/demo/Ice/throughput/Server.py
parentBug 454. (diff)
downloadice-502335f0e2d6d407b8c93690bd01d35c33e1f0cf.tar.bz2
ice-502335f0e2d6d407b8c93690bd01d35c33e1f0cf.tar.xz
ice-502335f0e2d6d407b8c93690bd01d35c33e1f0cf.zip
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=335
Diffstat (limited to 'py/demo/Ice/throughput/Server.py')
-rw-r--r--py/demo/Ice/throughput/Server.py39
1 files changed, 10 insertions, 29 deletions
diff --git a/py/demo/Ice/throughput/Server.py b/py/demo/Ice/throughput/Server.py
index 3b522433444..39743364d6d 100644
--- a/py/demo/Ice/throughput/Server.py
+++ b/py/demo/Ice/throughput/Server.py
@@ -77,32 +77,13 @@ class ThroughputI(Demo.Throughput):
def shutdown(self, current=None):
current.adapter.getCommunicator().shutdown()
-def run(argv, communicator):
- adapter = communicator.createObjectAdapter("Throughput")
- object = ThroughputI()
- adapter.add(object, Ice.stringToIdentity("throughput"))
- adapter.activate()
- communicator.waitForShutdown()
- return True
-
-try:
- properties = Ice.createProperties()
- properties.load("config")
- communicator = Ice.initializeWithProperties(sys.argv, properties)
- status = run(sys.argv, communicator)
-except:
- traceback.print_exc()
- status = False
-
-if communicator:
- try:
- communicator.destroy()
- except:
- traceback.print_exc()
- print ex
- status = False
-
-if status:
- sys.exit(0)
-else:
- sys.exit(1)
+class Server(Ice.Application):
+ def run(self, args):
+ adapter = self.communicator().createObjectAdapter("Throughput")
+ adapter.add(ThroughputI(), Ice.stringToIdentity("throughput"))
+ adapter.activate()
+ self.communicator().waitForShutdown()
+ return True
+
+app = Server()
+sys.exit(app.main(sys.argv, "config"))