diff options
author | Mark Spruiell <mes@zeroc.com> | 2004-09-07 15:49:24 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2004-09-07 15:49:24 +0000 |
commit | 922e164e2fc93e3338144917d0d4508df5ac69c0 (patch) | |
tree | 6ae637579f57bdc965d22d5c04abc4c124b2914e /py/demo/Ice/throughput/Server.py | |
parent | Change made for r1.227 did not correctly deal with Slice identifiers that (diff) | |
download | ice-922e164e2fc93e3338144917d0d4508df5ac69c0.tar.bz2 ice-922e164e2fc93e3338144917d0d4508df5ac69c0.tar.xz ice-922e164e2fc93e3338144917d0d4508df5ac69c0.zip |
initial check-in
Diffstat (limited to 'py/demo/Ice/throughput/Server.py')
-rw-r--r-- | py/demo/Ice/throughput/Server.py | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/py/demo/Ice/throughput/Server.py b/py/demo/Ice/throughput/Server.py new file mode 100644 index 00000000000..d847517d3a6 --- /dev/null +++ b/py/demo/Ice/throughput/Server.py @@ -0,0 +1,57 @@ +# ********************************************************************** +# +# 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('Throughput.ice') +import Demo + +class ThroughputI(Demo.Throughput): + def __init__(self): + self.seq = [] + self.seq[0:Demo.seqSize] = range(0, Demo.seqSize) + self.seq = [0 for x in self.seq] + + def sendByteSeq(self, seq, current=None): + pass + + def recvByteSeq(self, current=None): + return self.seq + + def echoByteSeq(self, seq, current=None): + return self.seq + +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 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) |