summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2009-12-02 12:50:07 -0330
committerDwayne Boone <dwayne@zeroc.com>2009-12-02 12:50:07 -0330
commite2b0fa942ac26da6942cb2830e6cedf3ff20e26f (patch)
tree8f60de07c06b46b5e53188b070800016ed5b26b0
parentBug 4398 - enable multi-core support on Windows (diff)
downloadice-e2b0fa942ac26da6942cb2830e6cedf3ff20e26f.tar.bz2
ice-e2b0fa942ac26da6942cb2830e6cedf3ff20e26f.tar.xz
ice-e2b0fa942ac26da6942cb2830e6cedf3ff20e26f.zip
Bug 1594 - Added interleaved demo
-rwxr-xr-xcpp/allDemos.py1
-rw-r--r--cpp/demo/Ice/Makefile3
-rw-r--r--cpp/demo/Ice/Makefile.mak3
-rw-r--r--cpp/demo/Ice/README6
-rwxr-xr-xcpp/demo/Ice/interleaved/.depend6
-rwxr-xr-xcpp/demo/Ice/interleaved/.gitignore7
-rwxr-xr-xcpp/demo/Ice/interleaved/Client.cpp388
-rwxr-xr-xcpp/demo/Ice/interleaved/Ice.interleaved.client.vcproj481
-rwxr-xr-xcpp/demo/Ice/interleaved/Ice.interleaved.server.vcproj521
-rwxr-xr-xcpp/demo/Ice/interleaved/Makefile51
-rwxr-xr-xcpp/demo/Ice/interleaved/Makefile.mak50
-rwxr-xr-xcpp/demo/Ice/interleaved/README22
-rwxr-xr-xcpp/demo/Ice/interleaved/Server.cpp44
-rwxr-xr-xcpp/demo/Ice/interleaved/Throughput.ice54
-rwxr-xr-xcpp/demo/Ice/interleaved/ThroughputI.cpp62
-rwxr-xr-xcpp/demo/Ice/interleaved/ThroughputI.h36
-rwxr-xr-xcpp/demo/Ice/interleaved/config.client20
-rwxr-xr-xcpp/demo/Ice/interleaved/config.server31
-rwxr-xr-xcpp/demo/Ice/interleaved/expect.py29
-rwxr-xr-xcpp/demo/demo.sln25
-rw-r--r--demoscript/Ice/interleaved.py55
21 files changed, 1890 insertions, 5 deletions
diff --git a/cpp/allDemos.py b/cpp/allDemos.py
index 78f1d98fe34..c281d5776c5 100755
--- a/cpp/allDemos.py
+++ b/cpp/allDemos.py
@@ -30,6 +30,7 @@ demos = [
"Ice/callback",
"Ice/converter",
"Ice/hello",
+ "Ice/interleaved",
"Ice/invoke",
"Ice/latency",
"Ice/minimal",
diff --git a/cpp/demo/Ice/Makefile b/cpp/demo/Ice/Makefile
index 9f0d25cce8d..28d299ae99b 100644
--- a/cpp/demo/Ice/Makefile
+++ b/cpp/demo/Ice/Makefile
@@ -25,7 +25,8 @@ SUBDIRS = minimal \
async \
multicast \
nrvo \
- plugin
+ plugin \
+ interleaved
$(EVERYTHING)::
@for subdir in $(SUBDIRS); \
diff --git a/cpp/demo/Ice/Makefile.mak b/cpp/demo/Ice/Makefile.mak
index ade9f14aef5..af35eec0c27 100644
--- a/cpp/demo/Ice/Makefile.mak
+++ b/cpp/demo/Ice/Makefile.mak
@@ -25,7 +25,8 @@ SUBDIRS = minimal \
async \
multicast \
nrvo \
- plugin
+ plugin \
+ interleaved
!if "$(CPP_COMPILER)" != "VC60"
SUBDIRS = $(SUBDIRS) \
diff --git a/cpp/demo/Ice/README b/cpp/demo/Ice/README
index 83e434ba7bc..cc8b5b2ea20 100644
--- a/cpp/demo/Ice/README
+++ b/cpp/demo/Ice/README
@@ -29,6 +29,12 @@ Demos in this directory:
well as how to invoke oneway operations, use datagrams, secure
invocations, and how to use batched invocations.
+- interleaved
+
+ A more advanced throughput demo that allows you to send sequences of
+ various types between client and server and to measure the maximum
+ bandwidth that can be achieved using asynchronous requests & replies.
+
- invoke
This demo illustrates the use of the Ice streaming API.
diff --git a/cpp/demo/Ice/interleaved/.depend b/cpp/demo/Ice/interleaved/.depend
new file mode 100755
index 00000000000..e98f10a13d8
--- /dev/null
+++ b/cpp/demo/Ice/interleaved/.depend
@@ -0,0 +1,6 @@
+Throughput$(OBJEXT): Throughput.cpp Throughput.h $(includedir)/Ice/LocalObjectF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/EndpointF.h $(includedir)/IceUtil/ScopedArray.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/EndpointTypes.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/Current.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/Identity.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/IncomingAsync.h $(includedir)/Ice/Direct.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/Ice/Stream.h $(includedir)/Ice/ObjectFactory.h $(includedir)/IceUtil/Iterator.h
+Client$(OBJEXT): Client.cpp $(includedir)/Ice/Ice.h $(includedir)/Ice/Initialize.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/LocalObjectF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/IceUtil/ScopedArray.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/EndpointF.h $(includedir)/Ice/EndpointTypes.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/Current.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/Identity.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/StatsF.h $(includedir)/Ice/StringConverter.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/Ice/Stream.h $(includedir)/IceUtil/Unicode.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/Properties.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/Direct.h $(includedir)/Ice/Logger.h $(includedir)/Ice/LoggerUtil.h $(includedir)/Ice/Stats.h $(includedir)/Ice/Communicator.h $(includedir)/Ice/RouterF.h $(includedir)/Ice/LocatorF.h $(includedir)/Ice/PluginF.h $(includedir)/Ice/ImplicitContextF.h $(includedir)/Ice/ObjectFactory.h $(includedir)/Ice/ObjectAdapter.h $(includedir)/Ice/FacetMap.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ServantLocator.h $(includedir)/Ice/IncomingAsync.h $(includedir)/Ice/Process.h $(includedir)/Ice/Application.h $(includedir)/Ice/Connection.h $(includedir)/Ice/Functional.h $(includedir)/IceUtil/Functional.h $(includedir)/Ice/ImplicitContext.h $(includedir)/Ice/Locator.h $(includedir)/Ice/FactoryTableInit.h $(includedir)/Ice/FactoryTable.h $(includedir)/IceUtil/StaticMutex.h $(includedir)/Ice/UserExceptionFactory.h $(includedir)/Ice/ProcessF.h $(includedir)/Ice/Router.h $(includedir)/Ice/DispatchInterceptor.h $(includedir)/Ice/IconvStringConverter.h Throughput.h
+ThroughputI$(OBJEXT): ThroughputI.cpp $(includedir)/Ice/Ice.h $(includedir)/Ice/Initialize.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/LocalObjectF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/IceUtil/ScopedArray.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/EndpointF.h $(includedir)/Ice/EndpointTypes.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/Current.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/Identity.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/StatsF.h $(includedir)/Ice/StringConverter.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/Ice/Stream.h $(includedir)/IceUtil/Unicode.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/Properties.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/Direct.h $(includedir)/Ice/Logger.h $(includedir)/Ice/LoggerUtil.h $(includedir)/Ice/Stats.h $(includedir)/Ice/Communicator.h $(includedir)/Ice/RouterF.h $(includedir)/Ice/LocatorF.h $(includedir)/Ice/PluginF.h $(includedir)/Ice/ImplicitContextF.h $(includedir)/Ice/ObjectFactory.h $(includedir)/Ice/ObjectAdapter.h $(includedir)/Ice/FacetMap.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ServantLocator.h $(includedir)/Ice/IncomingAsync.h $(includedir)/Ice/Process.h $(includedir)/Ice/Application.h $(includedir)/Ice/Connection.h $(includedir)/Ice/Functional.h $(includedir)/IceUtil/Functional.h $(includedir)/Ice/ImplicitContext.h $(includedir)/Ice/Locator.h $(includedir)/Ice/FactoryTableInit.h $(includedir)/Ice/FactoryTable.h $(includedir)/IceUtil/StaticMutex.h $(includedir)/Ice/UserExceptionFactory.h $(includedir)/Ice/ProcessF.h $(includedir)/Ice/Router.h $(includedir)/Ice/DispatchInterceptor.h $(includedir)/Ice/IconvStringConverter.h ThroughputI.h Throughput.h
+Server$(OBJEXT): Server.cpp $(includedir)/Ice/Ice.h $(includedir)/Ice/Initialize.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/LocalObjectF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/IceUtil/ScopedArray.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/EndpointF.h $(includedir)/Ice/EndpointTypes.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/Current.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/Identity.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/StatsF.h $(includedir)/Ice/StringConverter.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/Ice/Stream.h $(includedir)/IceUtil/Unicode.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/Properties.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/Direct.h $(includedir)/Ice/Logger.h $(includedir)/Ice/LoggerUtil.h $(includedir)/Ice/Stats.h $(includedir)/Ice/Communicator.h $(includedir)/Ice/RouterF.h $(includedir)/Ice/LocatorF.h $(includedir)/Ice/PluginF.h $(includedir)/Ice/ImplicitContextF.h $(includedir)/Ice/ObjectFactory.h $(includedir)/Ice/ObjectAdapter.h $(includedir)/Ice/FacetMap.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ServantLocator.h $(includedir)/Ice/IncomingAsync.h $(includedir)/Ice/Process.h $(includedir)/Ice/Application.h $(includedir)/Ice/Connection.h $(includedir)/Ice/Functional.h $(includedir)/IceUtil/Functional.h $(includedir)/Ice/ImplicitContext.h $(includedir)/Ice/Locator.h $(includedir)/Ice/FactoryTableInit.h $(includedir)/Ice/FactoryTable.h $(includedir)/IceUtil/StaticMutex.h $(includedir)/Ice/UserExceptionFactory.h $(includedir)/Ice/ProcessF.h $(includedir)/Ice/Router.h $(includedir)/Ice/DispatchInterceptor.h $(includedir)/Ice/IconvStringConverter.h ThroughputI.h Throughput.h
+Throughput.cpp: Throughput.ice
+Throughput.ice: $(SLICE2CPP) $(SLICEPARSERLIB)
diff --git a/cpp/demo/Ice/interleaved/.gitignore b/cpp/demo/Ice/interleaved/.gitignore
new file mode 100755
index 00000000000..ee1193c8569
--- /dev/null
+++ b/cpp/demo/Ice/interleaved/.gitignore
@@ -0,0 +1,7 @@
+// Generated by makegitignore.py
+
+// IMPORTANT: Do not edit this file -- any edits made here will be lost!
+client
+server
+Throughput.cpp
+Throughput.h
diff --git a/cpp/demo/Ice/interleaved/Client.cpp b/cpp/demo/Ice/interleaved/Client.cpp
new file mode 100755
index 00000000000..ca9e9c6a86a
--- /dev/null
+++ b/cpp/demo/Ice/interleaved/Client.cpp
@@ -0,0 +1,388 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2009 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.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <Throughput.h>
+
+#include <iomanip>
+
+#include <list>
+
+using namespace std;
+using namespace Demo;
+
+class Callback : public IceUtil::Shared
+{
+public:
+
+ Callback()
+ {
+ }
+
+ void response(const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&)
+ {
+ }
+
+ void responseSS(const StringSeq&)
+ {
+ }
+
+ void responseTS(const StringDoubleSeq&)
+ {
+ }
+
+ void responseFS(const FixedSeq&)
+ {
+ }
+
+ void exception(const ::Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ }
+};
+
+typedef IceUtil::Handle<Callback> CallbackPtr;
+
+class ThroughputClient : public Ice::Application
+{
+public:
+
+ ThroughputClient();
+ virtual int run(int, char*[]);
+
+private:
+
+ void menu();
+};
+
+int
+main(int argc, char* argv[])
+{
+ ThroughputClient app;
+ return app.main(argc, argv, "config.client");
+}
+
+ThroughputClient::ThroughputClient() :
+ //
+ // Since this is an interactive demo we don't want any signal
+ // handling.
+ //
+ Ice::Application(Ice::NoSignalHandling)
+{
+}
+
+int
+ThroughputClient::run(int argc, char* argv[])
+{
+ if(argc > 1)
+ {
+ cerr << appName() << ": too many arguments" << endl;
+ return EXIT_FAILURE;
+ }
+
+ ThroughputPrx throughput = ThroughputPrx::checkedCast(communicator()->propertyToProxy("Throughput.Proxy"));
+ if(!throughput)
+ {
+ cerr << argv[0] << ": invalid proxy" << endl;
+ return EXIT_FAILURE;
+ }
+
+ ThroughputPrx throughputOneway = ThroughputPrx::uncheckedCast(throughput->ice_oneway());
+
+ ByteSeq byteSeq(ByteSeqSize);
+ pair<const Ice::Byte*, const Ice::Byte*> byteArr;
+ byteArr.first = &byteSeq[0];
+ byteArr.second = byteArr.first + byteSeq.size();
+
+ StringSeq stringSeq(StringSeqSize, "hello");
+
+ StringDoubleSeq structSeq(StringDoubleSeqSize);
+ int i;
+ for(i = 0; i < StringDoubleSeqSize; ++i)
+ {
+ structSeq[i].s = "hello";
+ structSeq[i].d = 3.14;
+ }
+
+ FixedSeq fixedSeq(FixedSeqSize);
+ for(i = 0; i < FixedSeqSize; ++i)
+ {
+ fixedSeq[i].i = 0;
+ fixedSeq[i].j = 0;
+ fixedSeq[i].d = 0;
+ }
+
+ throughput->ice_ping(); // Initial ping to setup the connection.
+
+ menu();
+
+ //
+ // By default use byte sequence.
+ //
+ char currentType = '1';
+ int seqSize = ByteSeqSize;
+ // The maximum number of outstanding requests. -1 means
+ // unlimited. If the number of oustanding requests is unlimited
+ // and the server is slower than the client in processing the
+ // requests, high memory consumption will result.
+ int maxOutstanding = 2;
+
+ CallbackPtr cb = new Callback;
+
+ Callback_Throughput_echoByteSeqPtr byteSeqCB = newCallback_Throughput_echoByteSeq(
+ cb, &Callback::response, &Callback::exception);
+ Callback_Throughput_echoStringSeqPtr stringSeqCB = newCallback_Throughput_echoStringSeq(
+ cb, &Callback::responseSS, &Callback::exception);
+ Callback_Throughput_echoStructSeqPtr structSeqCB = newCallback_Throughput_echoStructSeq(
+ cb, &Callback::responseTS, &Callback::exception);
+ Callback_Throughput_echoFixedSeqPtr fixedSeqCB = newCallback_Throughput_echoFixedSeq(
+ cb, &Callback::responseFS, &Callback::exception);
+
+ char c;
+ do
+ {
+ try
+ {
+ cout << "==> ";
+ cin >> c;
+
+ IceUtil::Time tm = IceUtil::Time::now(IceUtil::Time::Monotonic);
+ const int repetitions = 1000;
+
+ if(c == 'o')
+ {
+ if(maxOutstanding == -1)
+ {
+ maxOutstanding = 2;
+ cout << "outstanding requests are now limited to 2." << endl;
+ }
+ else
+ {
+ maxOutstanding = -1;
+ cout << "outstanding requests are now unlimited." << endl;
+ }
+ }
+ else if(c == '1' || c == '2' || c == '3' || c == '4')
+ {
+ currentType = c;
+ switch(c)
+ {
+ case '1':
+ {
+ cout << "using byte sequences" << endl;
+ seqSize = ByteSeqSize;
+ break;
+ }
+
+ case '2':
+ {
+ cout << "using string sequences" << endl;
+ seqSize = StringSeqSize;
+ break;
+ }
+
+ case '3':
+ {
+ cout << "using variable-length struct sequences" << endl;
+ seqSize = StringDoubleSeqSize;
+ break;
+ }
+
+ case '4':
+ {
+ cout << "using fixed-length struct sequences" << endl;
+ seqSize = FixedSeqSize;
+ break;
+ }
+ }
+ }
+ else if(c == 'e')
+ {
+ cout << "sending and receiving";
+
+ cout << ' ' << repetitions;
+ switch(currentType)
+ {
+ case '1':
+ {
+ cout << " byte";
+ break;
+ }
+
+ case '2':
+ {
+ cout << " string";
+ break;
+ }
+
+ case '3':
+ {
+ cout << " variable-length struct";
+ break;
+ }
+
+ case '4':
+ {
+ cout << " fixed-length struct";
+ break;
+ }
+ }
+ cout << " sequences of size " << seqSize;
+
+ cout << "..." << endl;
+
+ list<Ice::AsyncResultPtr> results;
+ for(int i = 0; i < repetitions; ++i)
+ {
+ // Start the AMI request.
+ Ice::AsyncResultPtr r;
+ switch(currentType)
+ {
+ case '1':
+ r = throughput->begin_echoByteSeq(byteArr, byteSeqCB);
+ break;
+
+ case '2':
+ r = throughput->begin_echoStringSeq(stringSeq, stringSeqCB);
+ break;
+
+ case '3':
+ r = throughput->begin_echoStructSeq(structSeq, structSeqCB);
+ break;
+
+ case '4':
+ r = throughput->begin_echoFixedSeq(fixedSeq, fixedSeqCB);
+ break;
+ }
+ // For flow control purposes we want to restrict
+ // the number of sending messages to one. This
+ // avoids unnecessarily accumulating buffers in
+ // the Ice runtime, keeping memory usage low.
+ r->waitForSent();
+ results.push_back(r);
+
+ // Remove any completed requests from the list of
+ // pending results.
+ list<Ice::AsyncResultPtr>::iterator p = results.begin();
+ while(p != results.end())
+ {
+ if((*p)->isCompleted())
+ {
+ p = results.erase(p);
+ }
+ else
+ {
+ ++p;
+ }
+ }
+
+ // This avoids too many outstanding requests. This
+ // is desirable if the server doesn't limit the
+ // number of threads, or the server process
+ // requests slower than then client can send them.
+ while(maxOutstanding != -1 && static_cast<int>(results.size()) > maxOutstanding)
+ {
+ r = results.front();
+ results.pop_front();
+ r->waitForCompleted();
+ }
+ }
+ // Before we're complete we must wait for all
+ // responses to be received.
+ while(!results.empty())
+ {
+ Ice::AsyncResultPtr r = results.front();
+ results.pop_front();
+ r->waitForCompleted();
+ }
+
+ tm = IceUtil::Time::now(IceUtil::Time::Monotonic) - tm;
+ cout << "time for " << repetitions << " sequences: " << tm * 1000 << "ms" << endl;
+ cout << "time per sequence: " << tm * 1000 / repetitions << "ms" << endl;
+ int wireSize = 0;
+ switch(currentType)
+ {
+ case '1':
+ {
+ wireSize = 1;
+ break;
+ }
+ case '2':
+ {
+ wireSize = static_cast<int>(stringSeq[0].size());
+ break;
+ }
+ case '3':
+ {
+ wireSize = static_cast<int>(structSeq[0].s.size());
+ wireSize += 8; // Size of double on the wire.
+ break;
+ }
+ case '4':
+ {
+ wireSize = 16; // Size of two ints and a double on the wire.
+ break;
+ }
+ }
+ double mbit = repetitions * seqSize * wireSize * 8.0 / tm.toMicroSeconds();
+ if(c == 'e')
+ {
+ mbit *= 2;
+ }
+ cout << "throughput: " << setprecision(5) << mbit << "Mbps" << endl;
+ }
+ else if(c == 's')
+ {
+ throughput->shutdown();
+ }
+ else if(c == 'x')
+ {
+ // Nothing to do
+ }
+ else if(c == '?')
+ {
+ menu();
+ }
+ else
+ {
+ cout << "unknown command `" << c << "'" << endl;
+ menu();
+ }
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ }
+ }
+ while(cin.good() && c != 'x');
+
+ return EXIT_SUCCESS;
+}
+
+void
+ThroughputClient::menu()
+{
+ cout <<
+ "usage:\n"
+ "\n"
+ "toggle type of data to send:\n"
+ "1: sequence of bytes (default)\n"
+ "2: sequence of strings (\"hello\")\n"
+ "3: sequence of structs with a string (\"hello\") and a double\n"
+ "4: sequence of structs with two ints and a double\n"
+ "o: toggle the limit of outstanding requests\n"
+ "\n"
+ "select test to run:\n"
+ "e: Echo (send and receive) sequence\n"
+ "\n"
+ "other commands:\n"
+ "s: shutdown server\n"
+ "x: exit\n"
+ "?: help\n";
+}
diff --git a/cpp/demo/Ice/interleaved/Ice.interleaved.client.vcproj b/cpp/demo/Ice/interleaved/Ice.interleaved.client.vcproj
new file mode 100755
index 00000000000..69d8558da57
--- /dev/null
+++ b/cpp/demo/Ice/interleaved/Ice.interleaved.client.vcproj
@@ -0,0 +1,481 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="Ice.interleaved.client"
+ ProjectGUID="{798DC5EC-427F-49A6-9028-F2A420CCEA4B}"
+ RootNamespace="Ice.interleaved.client"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Debug/Ice.interleaved.client.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=". ; C:\Program Files\ZeroC\Ice-3.4b\include"
+ PreprocessorDefinitions="_CONSOLE;_DEBUG;WIN32_LEAN_AND_MEAN"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\Debug/Ice.interleaved.client.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ WarnAsError="true"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/FIXED:NO"
+ AdditionalDependencies="iced.lib iceutild.lib setargv.obj"
+ OutputFile="client.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="C:\Program Files\ZeroC\Ice-3.4b\lib"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/client.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\Debug/Ice.interleaved.client.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Release/Ice.interleaved.client.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=". ; C:\Program Files\ZeroC\Ice-3.4b\include"
+ PreprocessorDefinitions="_CONSOLE;NDEBUG;WIN32_LEAN_AND_MEAN"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\Release/Ice.interleaved.client.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ WarnAsError="true"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/FIXED:NO /IGNORE:4089"
+ AdditionalDependencies="ice.lib iceutil.lib setargv.obj"
+ OutputFile="client.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="C:\Program Files\ZeroC\Ice-3.4b\lib"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\Release/Ice.interleaved.client.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\Debug/Ice.interleaved.client.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=". ; ..\..\..\..\cpp\include"
+ PreprocessorDefinitions="_CONSOLE;_DEBUG;WIN32_LEAN_AND_MEAN"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\Debug/Ice.interleaved.client.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ WarnAsError="true"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/FIXED:NO"
+ AdditionalDependencies="iced.lib iceutild.lib setargv.obj"
+ OutputFile="client.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\..\..\cpp\lib"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/client.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\Debug/Ice.interleaved.client.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\Release/Ice.interleaved.client.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=". ; ..\..\..\..\cpp\include"
+ PreprocessorDefinitions="_CONSOLE;NDEBUG;WIN32_LEAN_AND_MEAN"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\Release/Ice.interleaved.client.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ WarnAsError="true"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/FIXED:NO /IGNORE:4089"
+ AdditionalDependencies="ice.lib iceutil.lib setargv.obj"
+ OutputFile="client.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\..\..\cpp\lib"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\Release/Ice.interleaved.client.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="Client.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\Throughput.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath=".\Throughput.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ <File
+ RelativePath=".\Throughput.ice"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="README"
+ >
+ </File>
+ </Files>
+ <Globals>
+ <Global
+ Name="ZerocIce_ConsoleOutput"
+ Value="True"
+ />
+ <Global
+ Name="ZerocIce_Enabled"
+ Value="True"
+ />
+ <Global
+ Name="ZerocIce_HomeExpanded"
+ Value="C:\Program Files\ZeroC\Ice-3.4b"
+ />
+ </Globals>
+</VisualStudioProject>
diff --git a/cpp/demo/Ice/interleaved/Ice.interleaved.server.vcproj b/cpp/demo/Ice/interleaved/Ice.interleaved.server.vcproj
new file mode 100755
index 00000000000..403b3577226
--- /dev/null
+++ b/cpp/demo/Ice/interleaved/Ice.interleaved.server.vcproj
@@ -0,0 +1,521 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="Ice.interleaved.server"
+ ProjectGUID="{383AB467-E29D-4A9D-A5D4-6BCA8E754A88}"
+ RootNamespace="Ice.interleaved.server"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Release/Ice.interleaved.server.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=". ; C:\Program Files\ZeroC\Ice-3.4b\include"
+ PreprocessorDefinitions="_CONSOLE;NDEBUG;WIN32_LEAN_AND_MEAN"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\Release/Ice.interleaved.server.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ WarnAsError="true"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/FIXED:NO /IGNORE:4089"
+ AdditionalDependencies="ice.lib iceutil.lib setargv.obj"
+ OutputFile="server.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="C:\Program Files\ZeroC\Ice-3.4b\lib"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\Release/Ice.interleaved.server.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Debug/Ice.interleaved.server.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=". ; C:\Program Files\ZeroC\Ice-3.4b\include"
+ PreprocessorDefinitions="_CONSOLE;_DEBUG;WIN32_LEAN_AND_MEAN"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\Debug/Ice.interleaved.server.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ WarnAsError="true"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/FIXED:NO"
+ AdditionalDependencies="iced.lib iceutild.lib setargv.obj"
+ OutputFile="server.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="C:\Program Files\ZeroC\Ice-3.4b\lib"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/server.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\Debug/Ice.interleaved.server.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\Release/Ice.interleaved.server.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=". ; ..\..\..\..\cpp\include"
+ PreprocessorDefinitions="_CONSOLE;NDEBUG;WIN32_LEAN_AND_MEAN"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\Release/Ice.interleaved.server.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ WarnAsError="true"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/FIXED:NO /IGNORE:4089"
+ AdditionalDependencies="ice.lib iceutil.lib setargv.obj"
+ OutputFile="server.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\..\..\cpp\lib"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\Release/Ice.interleaved.server.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\Debug/Ice.interleaved.server.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=". ; ..\..\..\..\cpp\include"
+ PreprocessorDefinitions="_CONSOLE;_DEBUG;WIN32_LEAN_AND_MEAN"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\Debug/Ice.interleaved.server.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ WarnAsError="true"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/FIXED:NO"
+ AdditionalDependencies="iced.lib iceutild.lib setargv.obj"
+ OutputFile="server.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\..\..\cpp\lib"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/server.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\Debug/Ice.interleaved.server.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="Server.cpp"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\Throughput.cpp"
+ >
+ </File>
+ <File
+ RelativePath="ThroughputI.cpp"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath=".\Throughput.h"
+ >
+ </File>
+ <File
+ RelativePath="ThroughputI.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ <File
+ RelativePath=".\Throughput.ice"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="README"
+ >
+ </File>
+ </Files>
+ <Globals>
+ <Global
+ Name="ZerocIce_ConsoleOutput"
+ Value="True"
+ />
+ <Global
+ Name="ZerocIce_Enabled"
+ Value="True"
+ />
+ <Global
+ Name="ZerocIce_HomeExpanded"
+ Value="C:\Program Files\ZeroC\Ice-3.4b"
+ />
+ </Globals>
+</VisualStudioProject>
diff --git a/cpp/demo/Ice/interleaved/Makefile b/cpp/demo/Ice/interleaved/Makefile
new file mode 100755
index 00000000000..c29d54ba54c
--- /dev/null
+++ b/cpp/demo/Ice/interleaved/Makefile
@@ -0,0 +1,51 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2009 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.
+#
+# **********************************************************************
+
+top_srcdir = ../../..
+
+CLIENT = client
+SERVER = server
+
+TARGETS = $(CLIENT) $(SERVER)
+
+OBJS = Throughput.o
+
+COBJS = Client.o
+
+SOBJS = ThroughputI.o \
+ Server.o
+
+SRCS = $(OBJS:.o=.cpp) \
+ $(COBJS:.o=.cpp) \
+ $(SOBJS:.o=.cpp)
+
+SLICE_SRCS = Throughput.ice
+
+include $(top_srcdir)/config/Make.rules
+
+ifeq ($(CXX),aCC)
+#
+# Work-around 'quadrant warning' in aCC A.03.56
+# Puts string literals in read-write memory
+#
+EXTRA_CPPFLAGS := +ESnolit
+endif
+
+CPPFLAGS := -I. $(CPPFLAGS) $(EXTRA_CPPFLAGS)
+
+
+$(CLIENT): $(OBJS) $(COBJS)
+ rm -f $@
+ $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(COBJS) $(LIBS)
+
+$(SERVER): $(OBJS) $(SOBJS)
+ rm -f $@
+ $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(SOBJS) $(LIBS)
+
+include .depend
diff --git a/cpp/demo/Ice/interleaved/Makefile.mak b/cpp/demo/Ice/interleaved/Makefile.mak
new file mode 100755
index 00000000000..869174a6e5d
--- /dev/null
+++ b/cpp/demo/Ice/interleaved/Makefile.mak
@@ -0,0 +1,50 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2009 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.
+#
+# **********************************************************************
+
+top_srcdir = ..\..\..
+
+CLIENT = client.exe
+SERVER = server.exe
+
+TARGETS = $(CLIENT) $(SERVER)
+
+OBJS = Throughput.obj
+
+COBJS = Client.obj
+
+SOBJS = ThroughputI.obj \
+ Server.obj
+
+SRCS = $(OBJS:.obj=.cpp) \
+ $(COBJS:.obj=.cpp) \
+ $(SOBJS:.obj=.cpp)
+
+!include $(top_srcdir)/config/Make.rules.mak
+
+CPPFLAGS = -I. $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN
+
+!if "$(GENERATE_PDB)" == "yes"
+CPDBFLAGS = /pdb:$(CLIENT:.exe=.pdb)
+SPDBFLAGS = /pdb:$(SERVER:.exe=.pdb)
+!endif
+
+$(CLIENT): $(OBJS) $(COBJS)
+ $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(OBJS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
+ @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \
+ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest
+
+$(SERVER): $(OBJS) $(SOBJS)
+ $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(SETARGV) $(OBJS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
+ @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \
+ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest
+
+clean::
+ del /q Throughput.cpp Throughput.h
+
+!include .depend
diff --git a/cpp/demo/Ice/interleaved/README b/cpp/demo/Ice/interleaved/README
new file mode 100755
index 00000000000..2c15f555be5
--- /dev/null
+++ b/cpp/demo/Ice/interleaved/README
@@ -0,0 +1,22 @@
+A more advanced throughput demo that allows you to send sequences of
+various types between client and server and to measure the maximum
+bandwidth that can be achieved using asynchronous requests & replies.
+
+To run the demo, first start the server:
+
+$ server
+
+In a separate window, start the client:
+
+$ client
+
+For the bytes sequence operations in this demo we provide some
+optimizations. For in paramaters we use the "cpp:array" metadata
+which on the server side means that the operation implementation is
+passed pointers into the marshalling buffer which eliminates a copy
+of the sequence data.
+
+For return paramaters we also use the "cpp:array" metadata, but this
+time in conjuction with AMD. Doing this also reduces the number of
+times the returned sequence is copied during marshalling.
+
diff --git a/cpp/demo/Ice/interleaved/Server.cpp b/cpp/demo/Ice/interleaved/Server.cpp
new file mode 100755
index 00000000000..ebe16885733
--- /dev/null
+++ b/cpp/demo/Ice/interleaved/Server.cpp
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2009 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.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <ThroughputI.h>
+
+using namespace std;
+
+class ThroughputServer : public Ice::Application
+{
+public:
+
+ virtual int run(int, char*[]);
+};
+
+int
+main(int argc, char* argv[])
+{
+ ThroughputServer app;
+ return app.main(argc, argv, "config.server");
+}
+
+int
+ThroughputServer::run(int argc, char* argv[])
+{
+ if(argc > 1)
+ {
+ cerr << appName() << ": too many arguments" << endl;
+ return EXIT_FAILURE;
+ }
+
+ Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Throughput");
+ Demo::ThroughputPtr servant = new ThroughputI;
+ adapter->add(servant, communicator()->stringToIdentity("throughput"));
+ adapter->activate();
+ communicator()->waitForShutdown();
+ return EXIT_SUCCESS;
+}
diff --git a/cpp/demo/Ice/interleaved/Throughput.ice b/cpp/demo/Ice/interleaved/Throughput.ice
new file mode 100755
index 00000000000..0601e62aedc
--- /dev/null
+++ b/cpp/demo/Ice/interleaved/Throughput.ice
@@ -0,0 +1,54 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2009 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.
+//
+// **********************************************************************
+
+#ifndef THROUGHPUT_ICE
+#define THROUGHPUT_ICE
+
+module Demo
+{
+
+sequence<byte> ByteSeq;
+const int ByteSeqSize = 500000;
+
+sequence<string> StringSeq;
+const int StringSeqSize = 50000;
+
+struct StringDouble
+{
+ string s;
+ double d;
+};
+sequence<StringDouble> StringDoubleSeq;
+const int StringDoubleSeqSize = 50000;
+
+struct Fixed
+{
+ int i;
+ int j;
+ double d;
+};
+sequence<Fixed> FixedSeq;
+const int FixedSeqSize = 50000;
+
+interface Throughput
+{
+ ["amd", "cpp:array"] ByteSeq echoByteSeq(["cpp:array"] ByteSeq seq);
+
+ StringSeq echoStringSeq(StringSeq seq);
+
+ StringDoubleSeq echoStructSeq(StringDoubleSeq seq);
+
+ FixedSeq echoFixedSeq(FixedSeq seq);
+
+ void shutdown();
+};
+
+};
+
+#endif
diff --git a/cpp/demo/Ice/interleaved/ThroughputI.cpp b/cpp/demo/Ice/interleaved/ThroughputI.cpp
new file mode 100755
index 00000000000..74f13267c59
--- /dev/null
+++ b/cpp/demo/Ice/interleaved/ThroughputI.cpp
@@ -0,0 +1,62 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2009 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.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <ThroughputI.h>
+
+ThroughputI::ThroughputI() :
+ _byteSeq(Demo::ByteSeqSize),
+ _stringSeq(Demo::StringSeqSize, "hello"),
+ _structSeq(Demo::StringDoubleSeqSize),
+ _fixedSeq(Demo::FixedSeqSize)
+{
+ int i;
+ for(i = 0; i < Demo::StringDoubleSeqSize; ++i)
+ {
+ _structSeq[i].s = "hello";
+ _structSeq[i].d = 3.14;
+ }
+ for(i = 0; i < Demo::FixedSeqSize; ++i)
+ {
+ _fixedSeq[i].i = 0;
+ _fixedSeq[i].j = 0;
+ _fixedSeq[i].d = 0;
+ }
+}
+
+void
+ThroughputI::echoByteSeq_async(const Demo::AMD_Throughput_echoByteSeqPtr& cb,
+ const std::pair<const Ice::Byte*, const Ice::Byte*>& seq, const Ice::Current&)
+{
+ cb->ice_response(seq);
+}
+
+Demo::StringSeq
+ThroughputI::echoStringSeq(const Demo::StringSeq& seq, const Ice::Current&)
+{
+ return seq;
+}
+
+Demo::StringDoubleSeq
+ThroughputI::echoStructSeq(const Demo::StringDoubleSeq& seq, const Ice::Current&)
+{
+ return seq;
+}
+
+Demo::FixedSeq
+ThroughputI::echoFixedSeq(const Demo::FixedSeq& seq, const Ice::Current&)
+{
+ return seq;
+}
+
+void
+ThroughputI::shutdown(const Ice::Current& c)
+{
+ c.adapter->getCommunicator()->shutdown();
+}
diff --git a/cpp/demo/Ice/interleaved/ThroughputI.h b/cpp/demo/Ice/interleaved/ThroughputI.h
new file mode 100755
index 00000000000..aae4282d702
--- /dev/null
+++ b/cpp/demo/Ice/interleaved/ThroughputI.h
@@ -0,0 +1,36 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2009 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.
+//
+// **********************************************************************
+
+#ifndef THROUGHPUT_I_H
+#define THROUGHPUT_I_H
+
+#include <Throughput.h>
+
+class ThroughputI : public Demo::Throughput
+{
+public:
+
+ ThroughputI();
+
+ virtual void echoByteSeq_async(const Demo::AMD_Throughput_echoByteSeqPtr&,
+ const std::pair<const Ice::Byte*, const Ice::Byte*>&, const Ice::Current&);
+ virtual Demo::StringSeq echoStringSeq(const Demo::StringSeq&, const Ice::Current&);
+ virtual Demo::StringDoubleSeq echoStructSeq(const Demo::StringDoubleSeq&, const Ice::Current&);
+ virtual Demo::FixedSeq echoFixedSeq(const Demo::FixedSeq&, const Ice::Current&);
+ virtual void shutdown(const Ice::Current& c);
+
+private:
+
+ Demo::ByteSeq _byteSeq;
+ Demo::StringSeq _stringSeq;
+ Demo::StringDoubleSeq _structSeq;
+ Demo::FixedSeq _fixedSeq;
+};
+
+#endif
diff --git a/cpp/demo/Ice/interleaved/config.client b/cpp/demo/Ice/interleaved/config.client
new file mode 100755
index 00000000000..4ad70cb1198
--- /dev/null
+++ b/cpp/demo/Ice/interleaved/config.client
@@ -0,0 +1,20 @@
+#
+# The client reads this property to create the reference to the
+# "Throughput" object in the server.
+#
+Throughput.Proxy=throughput:default -p 10000 -h 127.0.0.1
+
+#
+# Disable client-side ACM.
+#
+Ice.ACM.Client=0
+
+#
+# SSL Configuration
+#
+Ice.Plugin.IceSSL=IceSSL:createIceSSL
+IceSSL.DefaultDir=../../../../certs
+IceSSL.CertAuthFile=cacert.pem
+IceSSL.CertFile=c_rsa1024_pub.pem
+IceSSL.KeyFile=c_rsa1024_priv.pem
+
diff --git a/cpp/demo/Ice/interleaved/config.server b/cpp/demo/Ice/interleaved/config.server
new file mode 100755
index 00000000000..b1ffee8d0be
--- /dev/null
+++ b/cpp/demo/Ice/interleaved/config.server
@@ -0,0 +1,31 @@
+#
+# The server creates one single object adapter with the name
+# "Throughput". The following line sets the endpoints for this
+# adapter.
+#
+Throughput.Endpoints=default -p 10000
+
+#
+# For this test since the server is constantly receiving requests we
+# want two threads in the pool.
+#
+Ice.ThreadPool.Server.Size=2
+
+#
+# No warnings please.
+#
+Ice.ThreadPool.Server.SizeWarn=0
+
+#
+# Warn about connection exceptions
+#
+Ice.Warn.Connections=1
+
+#
+# SSL Configuration
+#
+Ice.Plugin.IceSSL=IceSSL:createIceSSL
+IceSSL.DefaultDir=../../../../certs
+IceSSL.CertAuthFile=cacert.pem
+IceSSL.CertFile=s_rsa1024_pub.pem
+IceSSL.KeyFile=s_rsa1024_priv.pem
diff --git a/cpp/demo/Ice/interleaved/expect.py b/cpp/demo/Ice/interleaved/expect.py
new file mode 100755
index 00000000000..98c1bba87d8
--- /dev/null
+++ b/cpp/demo/Ice/interleaved/expect.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2009 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, os
+
+path = [ ".", "..", "../..", "../../..", "../../../.." ]
+head = os.path.dirname(sys.argv[0])
+if len(head) > 0:
+ path = [os.path.join(head, p) for p in path]
+path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ]
+if len(path) == 0:
+ raise "can't find toplevel directory!"
+sys.path.append(path[0])
+
+from demoscript import *
+from demoscript.Ice import interleaved
+
+server = Util.spawn('./server --Ice.PrintAdapterReady')
+server.expect('.* ready')
+client = Util.spawn('./client')
+
+interleaved.run(client, server)
diff --git a/cpp/demo/demo.sln b/cpp/demo/demo.sln
index a8169476262..13ebd9b040d 100755
--- a/cpp/demo/demo.sln
+++ b/cpp/demo/demo.sln
@@ -309,6 +309,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cookbook.compression.client
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cookbook.compression.server", "cookbook\compression\cookbook.compression.server.vcproj", "{8A43ED0A-C9ED-4F92-983B-0FE97673F77D}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Ice.interleaved.client", "Ice\interleaved\Ice.interleaved.client.vcproj", "{798DC5EC-427F-49A6-9028-F2A420CCEA4B}"
+ ProjectSection(ProjectDependencies) = postProject
+ {383AB467-E29D-4A9D-A5D4-6BCA8E754A88} = {383AB467-E29D-4A9D-A5D4-6BCA8E754A88}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Ice.interleaved.server", "Ice\interleaved\Ice.interleaved.server.vcproj", "{383AB467-E29D-4A9D-A5D4-6BCA8E754A88}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -1007,16 +1014,28 @@ Global
{EFCFF55E-CCD2-451E-A0B5-604249ECE4D1}.Release|x64.Build.0 = Release|x64
{E2E57877-5DC6-4C07-A1C2-2B78005A2CBF}.Debug|Win32.ActiveCfg = Debug|Win32
{E2E57877-5DC6-4C07-A1C2-2B78005A2CBF}.Debug|Win32.Build.0 = Debug|Win32
- {E2E57877-5DC6-4C07-A1C2-2B78005A2CBF}.Debug|x64.ActiveCfg = Debug|Win32
+ {E2E57877-5DC6-4C07-A1C2-2B78005A2CBF}.Debug|x64.ActiveCfg = Debug|x64
{E2E57877-5DC6-4C07-A1C2-2B78005A2CBF}.Release|Win32.ActiveCfg = Release|Win32
{E2E57877-5DC6-4C07-A1C2-2B78005A2CBF}.Release|Win32.Build.0 = Release|Win32
- {E2E57877-5DC6-4C07-A1C2-2B78005A2CBF}.Release|x64.ActiveCfg = Release|Win32
+ {E2E57877-5DC6-4C07-A1C2-2B78005A2CBF}.Release|x64.ActiveCfg = Release|x64
{8A43ED0A-C9ED-4F92-983B-0FE97673F77D}.Debug|Win32.ActiveCfg = Debug|Win32
{8A43ED0A-C9ED-4F92-983B-0FE97673F77D}.Debug|Win32.Build.0 = Debug|Win32
{8A43ED0A-C9ED-4F92-983B-0FE97673F77D}.Debug|x64.ActiveCfg = Debug|Win32
{8A43ED0A-C9ED-4F92-983B-0FE97673F77D}.Release|Win32.ActiveCfg = Release|Win32
{8A43ED0A-C9ED-4F92-983B-0FE97673F77D}.Release|Win32.Build.0 = Release|Win32
- {8A43ED0A-C9ED-4F92-983B-0FE97673F77D}.Release|x64.ActiveCfg = Release|Win32
+ {8A43ED0A-C9ED-4F92-983B-0FE97673F77D}.Release|x64.ActiveCfg = Release|x64
+ {798DC5EC-427F-49A6-9028-F2A420CCEA4B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {798DC5EC-427F-49A6-9028-F2A420CCEA4B}.Debug|Win32.Build.0 = Debug|Win32
+ {798DC5EC-427F-49A6-9028-F2A420CCEA4B}.Debug|x64.ActiveCfg = Debug|x64
+ {798DC5EC-427F-49A6-9028-F2A420CCEA4B}.Release|Win32.ActiveCfg = Release|Win32
+ {798DC5EC-427F-49A6-9028-F2A420CCEA4B}.Release|Win32.Build.0 = Release|Win32
+ {798DC5EC-427F-49A6-9028-F2A420CCEA4B}.Release|x64.ActiveCfg = Release|x64
+ {383AB467-E29D-4A9D-A5D4-6BCA8E754A88}.Debug|Win32.ActiveCfg = Debug|Win32
+ {383AB467-E29D-4A9D-A5D4-6BCA8E754A88}.Debug|Win32.Build.0 = Debug|Win32
+ {383AB467-E29D-4A9D-A5D4-6BCA8E754A88}.Debug|x64.ActiveCfg = Debug|x64
+ {383AB467-E29D-4A9D-A5D4-6BCA8E754A88}.Release|Win32.ActiveCfg = Release|Win32
+ {383AB467-E29D-4A9D-A5D4-6BCA8E754A88}.Release|Win32.Build.0 = Release|Win32
+ {383AB467-E29D-4A9D-A5D4-6BCA8E754A88}.Release|x64.ActiveCfg = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/demoscript/Ice/interleaved.py b/demoscript/Ice/interleaved.py
new file mode 100644
index 00000000000..cc354447a52
--- /dev/null
+++ b/demoscript/Ice/interleaved.py
@@ -0,0 +1,55 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2009 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
+from demoscript import *
+from scripts import Expect
+
+def runseries(client):
+ print "testing bytes..."
+ client.expect('==> ', timeout=240)
+ client.sendline('e')
+ client.expect('==> ', timeout=2000)
+ print "echo: %s " % (client.before)
+
+ print "testing strings..."
+ client.sendline('2')
+ client.expect('==> ', timeout=240)
+ client.sendline('e')
+ client.expect('==> ', timeout=2000)
+ print "echo: %s " % (client.before)
+
+ print "testing structs with string..."
+ client.sendline('3')
+ client.expect('==> ', timeout=240)
+ client.sendline('e')
+ client.expect('==> ', timeout=2000)
+ print "echo: %s " % (client.before)
+
+ print "testing structs with two ints and double..."
+ client.sendline('4')
+ client.expect('==> ', timeout=240)
+ client.sendline('e')
+ client.expect('==> ', timeout=2000)
+ print "echo: %s " % (client.before)
+
+def run(client, server):
+ print "testing with 2 outstanding requests\n"
+ runseries(client)
+
+ print "testing with unlimited outstanding requests\n"
+ client.sendline('o')
+ runseries(client)
+
+ client.sendline('s')
+ server.waitTestSuccess()
+
+ client.sendline('x')
+ client.waitTestSuccess()