summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/demo/Ice/Makefile3
-rw-r--r--cpp/demo/Ice/Makefile.mak3
-rw-r--r--cpp/demo/Ice/README5
-rw-r--r--cpp/demo/Ice/async/.depend7
-rw-r--r--cpp/demo/Ice/async/Consumer.cpp113
-rw-r--r--cpp/demo/Ice/async/Makefile50
-rw-r--r--cpp/demo/Ice/async/Makefile.mak54
-rw-r--r--cpp/demo/Ice/async/Publisher.cpp109
-rw-r--r--cpp/demo/Ice/async/Queue.ice24
-rw-r--r--cpp/demo/Ice/async/QueueI.cpp69
-rw-r--r--cpp/demo/Ice/async/QueueI.h32
-rw-r--r--cpp/demo/Ice/async/README16
-rw-r--r--cpp/demo/Ice/async/asyncC.dsp157
-rw-r--r--cpp/demo/Ice/async/asyncP.dsp157
-rw-r--r--cpp/demo/Ice/async/asyncS.dsp165
-rw-r--r--cpp/demo/Ice/async/config.client28
-rw-r--r--cpp/demo/Ice/async/config.server29
-rwxr-xr-xcpp/demo/demo.dsw36
18 files changed, 1055 insertions, 2 deletions
diff --git a/cpp/demo/Ice/Makefile b/cpp/demo/Ice/Makefile
index 6e8285fd507..b146ffb82cb 100644
--- a/cpp/demo/Ice/Makefile
+++ b/cpp/demo/Ice/Makefile
@@ -21,7 +21,8 @@ SUBDIRS = minimal \
invoke \
bidir \
session \
- converter
+ converter \
+ async
$(EVERYTHING)::
@for subdir in $(SUBDIRS); \
diff --git a/cpp/demo/Ice/Makefile.mak b/cpp/demo/Ice/Makefile.mak
index 2429b5e0dd9..e3047e8203e 100644
--- a/cpp/demo/Ice/Makefile.mak
+++ b/cpp/demo/Ice/Makefile.mak
@@ -21,7 +21,8 @@ SUBDIRS = minimal \
invoke \
bidir \
session \
- converter
+ converter \
+ async
!if "$(BORLAND_HOME)" == ""
SUBDIRS = $(SUBDIRS) MFC
diff --git a/cpp/demo/Ice/README b/cpp/demo/Ice/README
index b13154ec3f9..b8711c01829 100644
--- a/cpp/demo/Ice/README
+++ b/cpp/demo/Ice/README
@@ -63,3 +63,8 @@ Demos in this directory:
- converter
This demo shows how to use string converters.
+
+- async
+
+ This demo illustrates the use of Aysynchronous Message Invocation (AMI)
+ and Aysynchronous Message Dispatch (AMD).
diff --git a/cpp/demo/Ice/async/.depend b/cpp/demo/Ice/async/.depend
new file mode 100644
index 00000000000..0634d2e113b
--- /dev/null
+++ b/cpp/demo/Ice/async/.depend
@@ -0,0 +1,7 @@
+Queue$(OBJEXT): Queue.cpp Queue.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ObjectF.h ../../../include/Ice/GCCountMap.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionIF.h ../../../include/Ice/EndpointIF.h ../../../include/Ice/Endpoint.h ../../../include/Ice/UndefSysMacros.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/Identity.h ../../../include/Ice/StreamF.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/Object.h ../../../include/Ice/GCShared.h ../../../include/Ice/GCRecMutex.h ../../../include/IceUtil/RecMutex.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/InstanceF.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Protocol.h ../../../include/Ice/StringConverter.h ../../../include/IceUtil/Unicode.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Direct.h ../../../include/Ice/LocalException.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/ObjectFactory.h ../../../include/IceUtil/Iterator.h ../../../include/IceUtil/ScopedArray.h
+Consumer$(OBJEXT): Consumer.cpp ../../../include/Ice/Application.h ../../../include/Ice/Ice.h ../../../include/Ice/GCRecMutex.h ../../../include/IceUtil/RecMutex.h ../../../include/IceUtil/Config.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/IceUtil/Exception.h ../../../include/Ice/Config.h ../../../include/Ice/GCShared.h ../../../include/Ice/GCCountMap.h ../../../include/Ice/GC.h ../../../include/IceUtil/Thread.h ../../../include/IceUtil/Shared.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/Ice/UndefSysMacros.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/LoggerF.h ../../../include/Ice/StreamF.h ../../../include/Ice/StatsF.h ../../../include/Ice/StringConverter.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionIF.h ../../../include/Ice/EndpointIF.h ../../../include/Ice/Endpoint.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/Identity.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ImplicitContextF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/Object.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/Ice/BasicStream.h ../../../include/Ice/Buffer.h ../../../include/Ice/Protocol.h ../../../include/IceUtil/Unicode.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Direct.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/IceUtil/StaticMutex.h ../../../include/Ice/UserExceptionFactoryF.h ../../../include/Ice/FacetMap.h ../../../include/Ice/Locator.h ../../../include/Ice/ProcessF.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/Process.h ../../../include/Ice/Connection.h ../../../include/Ice/Functional.h ../../../include/IceUtil/Functional.h ../../../include/Ice/Stream.h ../../../include/Ice/ImplicitContext.h Queue.h
+QueueI$(OBJEXT): QueueI.cpp QueueI.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Config.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/IceUtil/Exception.h Queue.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ObjectF.h ../../../include/Ice/GCCountMap.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/Proxy.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionIF.h ../../../include/Ice/EndpointIF.h ../../../include/Ice/Endpoint.h ../../../include/Ice/UndefSysMacros.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/Identity.h ../../../include/Ice/StreamF.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/Object.h ../../../include/Ice/GCShared.h ../../../include/Ice/GCRecMutex.h ../../../include/IceUtil/RecMutex.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/InstanceF.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Protocol.h ../../../include/Ice/StringConverter.h ../../../include/IceUtil/Unicode.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Direct.h
+Server$(OBJEXT): Server.cpp QueueI.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Config.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/IceUtil/Exception.h Queue.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ObjectF.h ../../../include/Ice/GCCountMap.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/Proxy.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionIF.h ../../../include/Ice/EndpointIF.h ../../../include/Ice/Endpoint.h ../../../include/Ice/UndefSysMacros.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/Identity.h ../../../include/Ice/StreamF.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/Object.h ../../../include/Ice/GCShared.h ../../../include/Ice/GCRecMutex.h ../../../include/IceUtil/RecMutex.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/InstanceF.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Buffer.h ../../../include/Ice/Protocol.h ../../../include/Ice/StringConverter.h ../../../include/IceUtil/Unicode.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Direct.h ../../../include/Ice/Application.h ../../../include/Ice/Ice.h ../../../include/Ice/GC.h ../../../include/IceUtil/Thread.h ../../../include/Ice/Initialize.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/LoggerF.h ../../../include/Ice/StatsF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ImplicitContextF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/IceUtil/StaticMutex.h ../../../include/Ice/UserExceptionFactoryF.h ../../../include/Ice/FacetMap.h ../../../include/Ice/Locator.h ../../../include/Ice/ProcessF.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/Process.h ../../../include/Ice/Connection.h ../../../include/Ice/Functional.h ../../../include/IceUtil/Functional.h ../../../include/Ice/Stream.h ../../../include/Ice/ImplicitContext.h
+Publisher$(OBJEXT): Publisher.cpp ../../../include/Ice/Application.h ../../../include/Ice/Ice.h ../../../include/Ice/GCRecMutex.h ../../../include/IceUtil/RecMutex.h ../../../include/IceUtil/Config.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/IceUtil/Exception.h ../../../include/Ice/Config.h ../../../include/Ice/GCShared.h ../../../include/Ice/GCCountMap.h ../../../include/Ice/GC.h ../../../include/IceUtil/Thread.h ../../../include/IceUtil/Shared.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/Ice/UndefSysMacros.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/LoggerF.h ../../../include/Ice/StreamF.h ../../../include/Ice/StatsF.h ../../../include/Ice/StringConverter.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionIF.h ../../../include/Ice/EndpointIF.h ../../../include/Ice/Endpoint.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/Identity.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/Stats.h ../../../include/Ice/Communicator.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ImplicitContextF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/Object.h ../../../include/Ice/IncomingAsyncF.h ../../../include/Ice/Outgoing.h ../../../include/Ice/BasicStream.h ../../../include/Ice/Buffer.h ../../../include/Ice/Protocol.h ../../../include/IceUtil/Unicode.h ../../../include/Ice/OutgoingAsync.h ../../../include/Ice/Incoming.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/ServantManagerF.h ../../../include/Ice/IncomingAsync.h ../../../include/Ice/Direct.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/FactoryTable.h ../../../include/Ice/FactoryTableDef.h ../../../include/IceUtil/StaticMutex.h ../../../include/Ice/UserExceptionFactoryF.h ../../../include/Ice/FacetMap.h ../../../include/Ice/Locator.h ../../../include/Ice/ProcessF.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/Process.h ../../../include/Ice/Connection.h ../../../include/Ice/Functional.h ../../../include/IceUtil/Functional.h ../../../include/Ice/Stream.h ../../../include/Ice/ImplicitContext.h Queue.h
+Queue.cpp: Queue.ice
+Queue.ice: $(SLICE2CPP) $(SLICEPARSERLIB)
diff --git a/cpp/demo/Ice/async/Consumer.cpp b/cpp/demo/Ice/async/Consumer.cpp
new file mode 100644
index 00000000000..be16687b811
--- /dev/null
+++ b/cpp/demo/Ice/async/Consumer.cpp
@@ -0,0 +1,113 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2006 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/Application.h>
+#include <Queue.h>
+
+using namespace std;
+using namespace Demo;
+
+class AMI_Queue_getI : public AMI_Queue_get
+{
+public:
+
+ virtual void ice_response(const string& message)
+ {
+ cout << message << endl;
+ }
+
+ virtual void ice_exception(const ::Ice::Exception& ex)
+ {
+ cout << ex << endl;
+ }
+};
+
+class QueueConsumer : public Ice::Application
+{
+public:
+
+ virtual int run(int, char*[]);
+
+private:
+
+ void menu();
+};
+
+int
+main(int argc, char* argv[])
+{
+ QueueConsumer app;
+ return app.main(argc, argv, "config.client");
+}
+
+int
+QueueConsumer::run(int argc, char* argv[])
+{
+ Ice::PropertiesPtr properties = communicator()->getProperties();
+ const char* proxyProperty = "Queue.Proxy";
+ string proxy = properties->getProperty(proxyProperty);
+ if(proxy.empty())
+ {
+ cerr << argv[0] << ": property `" << proxyProperty << "' not set" << endl;
+ return EXIT_FAILURE;
+ }
+
+ QueuePrx queue = QueuePrx::checkedCast(communicator()->stringToProxy(proxy));
+ if(!queue)
+ {
+ cerr << argv[0] << ": invalid proxy" << endl;
+ return EXIT_FAILURE;
+ }
+
+ menu();
+
+ char c;
+ do
+ {
+ try
+ {
+ cout << "==> ";
+ cin >> c;
+ if(c == 'g')
+ {
+ queue->get_async(new AMI_Queue_getI);
+ }
+ 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
+QueueConsumer::menu()
+{
+ cout <<
+ "usage:\n"
+ "g: get a message\n"
+ "x: exit\n"
+ "?: help\n";
+}
diff --git a/cpp/demo/Ice/async/Makefile b/cpp/demo/Ice/async/Makefile
new file mode 100644
index 00000000000..802508b5257
--- /dev/null
+++ b/cpp/demo/Ice/async/Makefile
@@ -0,0 +1,50 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2006 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 = ../../..
+
+PUBLISHER = publiser
+CONSUMER = consumer
+SERVER = server
+
+TARGETS = $(PUBLISHER) $(CONSUMER) $(SERVER)
+
+OBJS = Queue.o
+
+POBJS = Publisher.o
+
+COBJS = Consumer.o
+
+SOBJS = QueueI.o \
+ Server.o
+
+SRCS = $(OBJS:.o=.cpp) \
+ $(COBJS:.o=.cpp) \
+ $(SOBJS:.o=.cpp) \
+ $(POBJS:.o=.cpp)
+
+SLICE_SRCS = Queue.ice
+
+include $(top_srcdir)/config/Make.rules
+
+CPPFLAGS := -I. $(CPPFLAGS)
+
+$(PUBLISHER): $(OBJS) $(POBJS)
+ rm -f $@
+ $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(POBJS) $(LIBS)
+
+$(CONSUMER): $(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/async/Makefile.mak b/cpp/demo/Ice/async/Makefile.mak
new file mode 100644
index 00000000000..57094eb79d1
--- /dev/null
+++ b/cpp/demo/Ice/async/Makefile.mak
@@ -0,0 +1,54 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2006 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 = ..\..\..
+
+PUBLISHER = publisher.exe
+CONSUMER = consumer.exe
+SERVER = server.exe
+
+TARGETS = $(PUBLISHER) $(CONSUMER) $(SERVER)
+
+OBJS = Queue.obj
+
+POBJS = Publisher.obj
+
+COBJS = Consumer.obj
+
+SOBJS = QueueI.obj \
+ Server.obj
+
+SRCS = $(OBJS:.obj=.cpp) \
+ $(COBJS:.obj=.cpp) \
+ $(SOBJS:.obj=.cpp) \
+ $(POBJS:.obj=.cpp)
+
+!include $(top_srcdir)/config/Make.rules.mak
+
+CPPFLAGS = -I. $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN
+
+!if "$(BORLAND_HOME)" == "" & "$(OPTIMIZE)" != "yes"
+PPDBFLAGS = /pdb:$(PUBLISHER:.exe=.pdb)
+CPDBFLAGS = /pdb:$(CONSUMER:.exe=.pdb)
+SPDBFLAGS = /pdb:$(SERVER:.exe=.pdb)
+!endif
+
+$(PUBLISHER): $(OBJS) $(POBJS)
+ $(LINK) $(LD_EXEFLAGS) $(PPDBFLAGS) $(OBJS) $(POBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
+
+$(CONSUMER): $(OBJS) $(COBJS)
+ $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(OBJS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
+
+$(SERVER): $(OBJS) $(SOBJS)
+ $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(OBJS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
+
+clean::
+ del /q Queue.cpp Queue.h
+
+!include .depend
diff --git a/cpp/demo/Ice/async/Publisher.cpp b/cpp/demo/Ice/async/Publisher.cpp
new file mode 100644
index 00000000000..ca9e3fc6e8b
--- /dev/null
+++ b/cpp/demo/Ice/async/Publisher.cpp
@@ -0,0 +1,109 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2006 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/Application.h>
+#include <Queue.h>
+
+using namespace std;
+using namespace Demo;
+
+class QueuePublisher : public Ice::Application
+{
+public:
+
+ virtual int run(int, char*[]);
+
+private:
+
+ void menu();
+ string trim(const string& s);
+};
+
+int
+main(int argc, char* argv[])
+{
+ QueuePublisher app;
+ return app.main(argc, argv, "config.client");
+}
+
+int
+QueuePublisher::run(int argc, char* argv[])
+{
+ Ice::PropertiesPtr properties = communicator()->getProperties();
+ const char* proxyProperty = "Queue.Proxy";
+ string proxy = properties->getProperty(proxyProperty);
+ if(proxy.empty())
+ {
+ cerr << argv[0] << ": property `" << proxyProperty << "' not set" << endl;
+ return EXIT_FAILURE;
+ }
+
+ QueuePrx queue = QueuePrx::checkedCast(communicator()->stringToProxy(proxy));
+ if(!queue)
+ {
+ cerr << argv[0] << ": invalid proxy" << endl;
+ return EXIT_FAILURE;
+ }
+
+ cout << "Type a message and hit return to queue a message." << endl;
+ menu();
+
+ try
+ {
+ do
+ {
+ string s;
+ cout << "==> ";
+ getline(cin, s);
+ s = trim(s);
+ if(!s.empty())
+ {
+ if(s[0] == '/')
+ {
+ if(s == "/quit")
+ {
+ break;
+ }
+ menu();
+ }
+ else
+ {
+ queue->add(s);
+ }
+ }
+ }
+ while(cin.good());
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ return EXIT_FAILURE;
+ }
+
+ return EXIT_SUCCESS;
+}
+
+void
+QueuePublisher::menu()
+{
+ cout << "Enter /quit to exit." << endl;
+}
+
+string
+QueuePublisher::trim(const string& s)
+{
+ static const string delims = "\t\r\n ";
+ string::size_type last = s.find_last_not_of(delims);
+ if(last != string::npos)
+ {
+ return s.substr(s.find_first_not_of(delims), last+1);
+ }
+ return s;
+}
+
diff --git a/cpp/demo/Ice/async/Queue.ice b/cpp/demo/Ice/async/Queue.ice
new file mode 100644
index 00000000000..d275116694c
--- /dev/null
+++ b/cpp/demo/Ice/async/Queue.ice
@@ -0,0 +1,24 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2006 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 QUEUE_ICE
+#define QUEUE_ICE
+
+module Demo
+{
+
+interface Queue
+{
+ ["ami", "amd"] string get();
+ void add(string message);
+};
+
+};
+
+#endif
diff --git a/cpp/demo/Ice/async/QueueI.cpp b/cpp/demo/Ice/async/QueueI.cpp
new file mode 100644
index 00000000000..a2255c3d83f
--- /dev/null
+++ b/cpp/demo/Ice/async/QueueI.cpp
@@ -0,0 +1,69 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2006 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 <QueueI.h>
+
+using namespace std;
+
+void
+QueueI::get_async(const Demo::AMD_Queue_getPtr& getCB, const Ice::Current&)
+{
+ IceUtil::Mutex::Lock lock(*this);
+
+ //
+ // If there is already a message in the message queue, send the
+ // response immediately. Otherwise add the callback to the
+ // request queue.
+ //
+ if(_messageQueue.size() != 0)
+ {
+ try
+ {
+ getCB->ice_response(_messageQueue.front());
+ _messageQueue.pop_front();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cout << ex << endl;
+ }
+ }
+ else
+ {
+ _requestQueue.push_back(getCB);
+ }
+}
+
+void
+QueueI::add(const ::std::string& message, const Ice::Current&)
+{
+ IceUtil::Mutex::Lock lock(*this);
+
+ //
+ // If there is an outstanding request in the request queue,
+ // send a response. Otherwise add the message to the message
+ // queue.
+ //
+ if(_requestQueue.size() != 0)
+ {
+ try
+ {
+ _requestQueue.front()->ice_response(message);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ _messageQueue.push_back(message);
+ cout << ex << endl;
+ }
+ _requestQueue.pop_front();
+ }
+ else
+ {
+ _messageQueue.push_back(message);
+ }
+}
diff --git a/cpp/demo/Ice/async/QueueI.h b/cpp/demo/Ice/async/QueueI.h
new file mode 100644
index 00000000000..7daf86daf7e
--- /dev/null
+++ b/cpp/demo/Ice/async/QueueI.h
@@ -0,0 +1,32 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2006 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 QUEUE_I_H
+#define QUEUE_I_H
+
+#include <IceUtil/Mutex.h>
+#include <Queue.h>
+#include <list>
+
+class QueueI : virtual public Demo::Queue, public IceUtil::Mutex
+{
+public:
+
+ virtual void get_async(const Demo::AMD_Queue_getPtr&, const Ice::Current&);
+ virtual void add(const std::string&, const Ice::Current&);
+
+
+private:
+
+ std::list<std::string> _messageQueue;
+ std::list<Demo::AMD_Queue_getPtr> _requestQueue;
+};
+
+
+#endif
diff --git a/cpp/demo/Ice/async/README b/cpp/demo/Ice/async/README
new file mode 100644
index 00000000000..5356845ea5a
--- /dev/null
+++ b/cpp/demo/Ice/async/README
@@ -0,0 +1,16 @@
+This demo illustrates the use of Aysynchronous Message Invocation (AMI)
+and Aysynchronous Message Dispatch (AMD).
+
+To run the demo, first start the server:
+
+$ server
+
+In a second window, start the publisher:
+
+$ publisher
+
+In a third window, start the consumer:
+
+$ consumer
+
+Multiple publishers and consumers can be used if so desired.
diff --git a/cpp/demo/Ice/async/asyncC.dsp b/cpp/demo/Ice/async/asyncC.dsp
new file mode 100644
index 00000000000..690d96b8534
--- /dev/null
+++ b/cpp/demo/Ice/async/asyncC.dsp
@@ -0,0 +1,157 @@
+# Microsoft Developer Studio Project File - Name="asyncC" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=asyncC - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "asyncC.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "asyncC.mak" CFG="asyncC - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "asyncC - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "asyncC - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "asyncC - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /WX /GR /GX /O2 /I "." /I "../../../include" /I "../../../include/stlport" /D "_CONSOLE" /D "NDEBUG" /D "WIN32_LEAN_AND_MEAN" /FD /c
+# SUBTRACT CPP /Fr /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Ice.lib IceUtil.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"server.exe" /libpath:"../../../lib" /FIXED:no
+# SUBTRACT LINK32 /debug /nodefaultlib
+
+!ELSEIF "$(CFG)" == "asyncC - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /WX /Gm /GR /GX /Zi /Od /I "." /I "../../../include" /I "../../../include/stlport" /D "_CONSOLE" /D "_DEBUG" /D "WIN32_LEAN_AND_MEAN" /FD /GZ /c
+# SUBTRACT CPP /Fr /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Iced.lib IceUtild.lib /nologo /subsystem:console /debug /machine:I386 /out:"server.exe" /pdbtype:sept /libpath:"../../../lib" /FIXED:no
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "asyncC - Win32 Release"
+# Name "asyncC - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\Queue.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Consumer.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\Queue.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\Queue.ice
+
+!IF "$(CFG)" == "asyncC - Win32 Release"
+
+USERDEP__QUEUE="..\..\..\bin\slice2cpp.exe" "..\..\..\lib\slice.lib"
+# Begin Custom Build
+InputPath=.\Queue.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe Queue.ice
+
+"Queue.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Queue.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "asyncC - Win32 Debug"
+
+USERDEP__QUEUE="..\..\..\bin\slice2cpp.exe" "..\..\..\lib\sliced.lib"
+# Begin Custom Build
+InputPath=.\Queue.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe Queue.ice
+
+"Queue.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Queue.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\README
+# End Source File
+# End Target
+# End Project
diff --git a/cpp/demo/Ice/async/asyncP.dsp b/cpp/demo/Ice/async/asyncP.dsp
new file mode 100644
index 00000000000..52a91c16015
--- /dev/null
+++ b/cpp/demo/Ice/async/asyncP.dsp
@@ -0,0 +1,157 @@
+# Microsoft Developer Studio Project File - Name="asyncP" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=asyncP - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "asyncP.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "asyncP.mak" CFG="asyncP - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "asyncP - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "asyncP - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "asyncP - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /WX /GR /GX /O2 /I "." /I "../../../include" /I "../../../include/stlport" /D "_CONSOLE" /D "NDEBUG" /D "WIN32_LEAN_AND_MEAN" /FD /c
+# SUBTRACT CPP /Fr /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Ice.lib IceUtil.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"server.exe" /libpath:"../../../lib" /FIXED:no
+# SUBTRACT LINK32 /debug /nodefaultlib
+
+!ELSEIF "$(CFG)" == "asyncP - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /WX /Gm /GR /GX /Zi /Od /I "." /I "../../../include" /I "../../../include/stlport" /D "_CONSOLE" /D "_DEBUG" /D "WIN32_LEAN_AND_MEAN" /FD /GZ /c
+# SUBTRACT CPP /Fr /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Iced.lib IceUtild.lib /nologo /subsystem:console /debug /machine:I386 /out:"server.exe" /pdbtype:sept /libpath:"../../../lib" /FIXED:no
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "asyncP - Win32 Release"
+# Name "asyncP - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\Queue.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Publisher.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\Queue.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\Queue.ice
+
+!IF "$(CFG)" == "asyncP - Win32 Release"
+
+USERDEP__QUEUE="..\..\..\bin\slice2cpp.exe" "..\..\..\lib\slice.lib"
+# Begin Custom Build
+InputPath=.\Queue.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe Queue.ice
+
+"Queue.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Queue.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "asyncP - Win32 Debug"
+
+USERDEP__QUEUE="..\..\..\bin\slice2cpp.exe" "..\..\..\lib\sliced.lib"
+# Begin Custom Build
+InputPath=.\Queue.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe Queue.ice
+
+"Queue.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Queue.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\README
+# End Source File
+# End Target
+# End Project
diff --git a/cpp/demo/Ice/async/asyncS.dsp b/cpp/demo/Ice/async/asyncS.dsp
new file mode 100644
index 00000000000..c98df8ba5e5
--- /dev/null
+++ b/cpp/demo/Ice/async/asyncS.dsp
@@ -0,0 +1,165 @@
+# Microsoft Developer Studio Project File - Name="asyncS" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=asyncS - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "asyncS.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "asyncS.mak" CFG="asyncS - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "asyncS - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "asyncS - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "asyncS - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /WX /GR /GX /O2 /I "." /I "../../../include" /I "../../../include/stlport" /D "_CONSOLE" /D "NDEBUG" /D "WIN32_LEAN_AND_MEAN" /FD /c
+# SUBTRACT CPP /Fr /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Ice.lib IceUtil.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"server.exe" /libpath:"../../../lib" /FIXED:no
+# SUBTRACT LINK32 /debug /nodefaultlib
+
+!ELSEIF "$(CFG)" == "asyncS - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /WX /Gm /GR /GX /Zi /Od /I "." /I "../../../include" /I "../../../include/stlport" /D "_CONSOLE" /D "_DEBUG" /D "WIN32_LEAN_AND_MEAN" /FD /GZ /c
+# SUBTRACT CPP /Fr /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Iced.lib IceUtild.lib /nologo /subsystem:console /debug /machine:I386 /out:"server.exe" /pdbtype:sept /libpath:"../../../lib" /FIXED:no
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "asyncS - Win32 Release"
+# Name "asyncS - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\Queue.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\QueueI.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Server.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\Queue.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\QueueI.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\Queue.ice
+
+!IF "$(CFG)" == "asyncS - Win32 Release"
+
+USERDEP__QUEUE="..\..\..\bin\slice2cpp.exe" "..\..\..\lib\slice.lib"
+# Begin Custom Build
+InputPath=.\Queue.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe Queue.ice
+
+"Queue.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Queue.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "asyncS - Win32 Debug"
+
+USERDEP__QUEUE="..\..\..\bin\slice2cpp.exe" "..\..\..\lib\sliced.lib"
+# Begin Custom Build
+InputPath=.\Queue.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe Queue.ice
+
+"Queue.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Queue.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\README
+# End Source File
+# End Target
+# End Project
diff --git a/cpp/demo/Ice/async/config.client b/cpp/demo/Ice/async/config.client
new file mode 100644
index 00000000000..9cca378e1e3
--- /dev/null
+++ b/cpp/demo/Ice/async/config.client
@@ -0,0 +1,28 @@
+#
+# The client reads this property to create the reference to the
+# "hello" object in the server.
+#
+Queue.Proxy=queue:tcp -p 10000
+
+#
+# Warn about connection exceptions
+#
+Ice.Warn.Connections=1
+
+#
+# Network Tracing
+#
+# 0 = no network tracing
+# 1 = trace connection establishment and closure
+# 2 = like 1, but more detailed
+# 3 = like 2, but also trace data transfer
+#
+#Ice.Trace.Network=1
+
+#
+# Protocol Tracing
+#
+# 0 = no protocol tracing
+# 1 = trace protocol messages
+#
+#Ice.Trace.Protocol=1
diff --git a/cpp/demo/Ice/async/config.server b/cpp/demo/Ice/async/config.server
new file mode 100644
index 00000000000..fd72066f5a5
--- /dev/null
+++ b/cpp/demo/Ice/async/config.server
@@ -0,0 +1,29 @@
+#
+# The server creates one single object adapter with the name
+# "Queue". The following line sets the endpoints for this
+# adapter.
+#
+Queue.Endpoints=tcp -p 10000
+
+#
+# Warn about connection exceptions
+#
+Ice.Warn.Connections=1
+
+#
+# Network Tracing
+#
+# 0 = no network tracing
+# 1 = trace connection establishment and closure
+# 2 = like 1, but more detailed
+# 3 = like 2, but also trace data transfer
+#
+#Ice.Trace.Network=1
+
+#
+# Protocol Tracing
+#
+# 0 = no protocol tracing
+# 1 = trace protocol messages
+#
+#Ice.Trace.Protocol=1
diff --git a/cpp/demo/demo.dsw b/cpp/demo/demo.dsw
index a0f58d6c5f5..c3169d9e053 100755
--- a/cpp/demo/demo.dsw
+++ b/cpp/demo/demo.dsw
@@ -195,6 +195,42 @@ Package=<4>
###############################################################################
+Project: "asyncC"=.\Ice\async\asyncC.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "asyncP"=.\Ice\async\asyncP.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "asyncS"=.\Ice\async\asyncS.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
Project: "bench"=.\freeze\bench\bench.dsp - Package Owner=<4>
Package=<5>