summaryrefslogtreecommitdiff
path: root/cpp/demo
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2001-11-27 14:24:58 +0000
committerMatthew Newhook <matthew@zeroc.com>2001-11-27 14:24:58 +0000
commited26a91d70fb1dece4208e013f67a7a2da84d748 (patch)
treeca04992186bb24b55866bc5e54d3bc112d9100ea /cpp/demo
parentUpdated the SSL Connections to perform proper network tracing against (diff)
downloadice-ed26a91d70fb1dece4208e013f67a7a2da84d748.tar.bz2
ice-ed26a91d70fb1dece4208e013f67a7a2da84d748.tar.xz
ice-ed26a91d70fb1dece4208e013f67a7a2da84d748.zip
Update config file. Add README file. Small demo changes. Remove config file
from IceStorm src dir.
Diffstat (limited to 'cpp/demo')
-rw-r--r--cpp/demo/IceStorm/clock/Publisher.cpp12
-rw-r--r--cpp/demo/IceStorm/clock/README21
-rw-r--r--cpp/demo/IceStorm/clock/Subscriber.cpp19
-rw-r--r--cpp/demo/IceStorm/clock/config48
4 files changed, 86 insertions, 14 deletions
diff --git a/cpp/demo/IceStorm/clock/Publisher.cpp b/cpp/demo/IceStorm/clock/Publisher.cpp
index a148a85e94a..8686d797834 100644
--- a/cpp/demo/IceStorm/clock/Publisher.cpp
+++ b/cpp/demo/IceStorm/clock/Publisher.cpp
@@ -35,12 +35,18 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
return EXIT_FAILURE;
}
- IceStorm::TopicPrx topic = manager->retrieve("time");
- if (!topic)
+ IceStorm::TopicPrx topic;
+ try
+ {
+ topic = manager->retrieve("time");
+ }
+ catch(const IceStorm::NoSuchTopic& e)
{
- cerr << argv[0] << ": No topic `time'" << endl;
+ cerr << argv[0] << ": NoSuchTopic: " << e.name << endl;
return EXIT_FAILURE;
+
}
+ assert(topic);
//
// Get a publisher object, create a oneway proxy and then cast to
diff --git a/cpp/demo/IceStorm/clock/README b/cpp/demo/IceStorm/clock/README
new file mode 100644
index 00000000000..924080b943b
--- /dev/null
+++ b/cpp/demo/IceStorm/clock/README
@@ -0,0 +1,21 @@
+To run the demo:
+
+export ICE_CONFIG=config
+
+or use --Ice.Config=config for all subsequent commands.
+
+Start the IceStorm daemon:
+
+../../bin/icestorm
+
+In a seperate window:
+
+../../bin/icestormadmin create time
+./subscriber
+
+In another window:
+
+./publisher
+
+For each run of the publisher 10 "tick" messages should be displayed
+in the subscriber window.
diff --git a/cpp/demo/IceStorm/clock/Subscriber.cpp b/cpp/demo/IceStorm/clock/Subscriber.cpp
index 32158f9072b..02663318c28 100644
--- a/cpp/demo/IceStorm/clock/Subscriber.cpp
+++ b/cpp/demo/IceStorm/clock/Subscriber.cpp
@@ -41,11 +41,28 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
Ice::ObjectPrx object = adapter->createProxy(id);
+ //
+ // The set of topics to which to subscribe
+ //
IceStorm::StringSeq topics;
topics.push_back("time");
+
+ //
+ // The requested quality of service. This requests "reliability" =
+ // "batch". This asks IceStorm to send events to the subscriber in
+ // batches at regular intervals.
+ //
IceStorm::QoS qos;
qos["reliability"] = "batch";
- manager->subscribe("events", qos, topics, object);
+ try
+ {
+ manager->subscribe("events", qos, topics, object);
+ }
+ catch(const IceStorm::NoSuchTopic& e)
+ {
+ cerr << argv[0] << ": NoSuchTopic: " << e.name << endl;
+ return EXIT_FAILURE;
+ }
adapter->activate();
diff --git a/cpp/demo/IceStorm/clock/config b/cpp/demo/IceStorm/clock/config
index 52c9e669fc9..c1d445b3b5d 100644
--- a/cpp/demo/IceStorm/clock/config
+++ b/cpp/demo/IceStorm/clock/config
@@ -5,19 +5,47 @@
IceStorm.TopicManager=TopicManager:tcp -h localhost -p 10000
#
-# Network Tracing
+# This property sets the endpoint for the TopicManager. The port
+# number must match the above.
#
-# 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.Adapter.TopicManager.Endpoints=tcp -p 10000
+
+#
+# TopicManager Tracing
+#
+# 0 = no tracing
+# 1 = trace topic creation, subscription, unsubscription
+# 2 = like 1, but with more detailed subscription information
+#
+IceStorm.Trace.TopicManager=2
+
+#
+# Topic Tracing
+#
+# 0 = no tracing
+# 1 = trace unsubscription diagnostics
#
-#Ice.Trace.Network=1
+IceStorm.Trace.Topic=1
#
-# Protocol Tracing
+# Subscriber Tracing
+#
+# 0 = no tracing
+# 1 = subscriber diagnostics (subscription, unsubscription, event
+# propagation failures)
+#
+IceStorm.Trace.Subscriber=1
+
+#
+# Flush Tracing (for batch mode transfer flushing)
+#
+# 0 = no tracing
+# 1 = trace activity of flusher thread
+#
+IceStorm.Trace.Flush=1
+
#
-# 0 = no protocol tracing
-# 1 = trace protocol messages
+# Amount of time in milliseconds between flushes for batch mode
+# transfer. The minimum allowable value is 100ms.
#
-#Ice.Trace.Protocol=1
+IceStorm.Flush.Timeout = 2000