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/callback/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/callback/Server.py')
-rw-r--r-- | py/demo/Ice/callback/Server.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/py/demo/Ice/callback/Server.py b/py/demo/Ice/callback/Server.py new file mode 100644 index 00000000000..5a1f767c276 --- /dev/null +++ b/py/demo/Ice/callback/Server.py @@ -0,0 +1,39 @@ +# ********************************************************************** +# +# 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('Callback.ice') +import Demo + +class CallbackI(Demo.Callback): + def initiateCallback(self, proxy, current=None): + print "initiating callback" + try: + proxy.callback(current.ctx) + except Ice.Exception, ex: + print ex + + def shutdown(self, current=None): + print "Shutting down..." + try: + current.adapter.getCommunicator().shutdown() + except Ice.Exception, ex: + print ex + +class CallbackServer(Ice.Application): + def run(self, args): + adapter = self.communicator().createObjectAdapter("Callback.Server") + adapter.add(CallbackI(), Ice.stringToIdentity("callback")) + adapter.activate() + self.communicator().waitForShutdown() + return 0 + +app = CallbackServer() +sys.exit(app.main(sys.argv, "config")) |