diff options
author | Mark Spruiell <mes@zeroc.com> | 2004-09-04 14:51:31 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2004-09-04 14:51:31 +0000 |
commit | 3ef447033e4b5b97e9ac52eda57f969072fd8ddc (patch) | |
tree | 8bac601c1ea7175695a71ba14924b62c77f40b49 /py/demo/Ice/latency/Server.py | |
parent | eliminating duplicate functions in Util and PythonUtil (diff) | |
download | ice-3ef447033e4b5b97e9ac52eda57f969072fd8ddc.tar.bz2 ice-3ef447033e4b5b97e9ac52eda57f969072fd8ddc.tar.xz ice-3ef447033e4b5b97e9ac52eda57f969072fd8ddc.zip |
initial check-in
Diffstat (limited to 'py/demo/Ice/latency/Server.py')
-rw-r--r-- | py/demo/Ice/latency/Server.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/py/demo/Ice/latency/Server.py b/py/demo/Ice/latency/Server.py new file mode 100644 index 00000000000..4711e3a8aa7 --- /dev/null +++ b/py/demo/Ice/latency/Server.py @@ -0,0 +1,42 @@ +# ********************************************************************** +# +# Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved. +# +# This copy of Ice is licensed to you under the terms described in the +# ICE_LICENSE file included in this distribution. +# +# ********************************************************************** + +import sys, Ice + +Ice.loadSlice('Latency.ice') +import Demo + +def run(argv, communicator): + adapter = communicator.createObjectAdapter("Latency") + object = Demo.Ping() + adapter.add(object, Ice.stringToIdentity("ping")) + 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 Ice.Exception, ex: + print ex + status = False + +if communicator: + try: + communicator.destroy() + except Ice.Exception, ex: + print ex + status = False + +if status: + sys.exit(0) +else: + sys.exit(1) |