summaryrefslogtreecommitdiff
path: root/cpp/demo/IceDiscovery/hello/HelloI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/demo/IceDiscovery/hello/HelloI.cpp')
-rw-r--r--cpp/demo/IceDiscovery/hello/HelloI.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/cpp/demo/IceDiscovery/hello/HelloI.cpp b/cpp/demo/IceDiscovery/hello/HelloI.cpp
new file mode 100644
index 00000000000..b25d3b886af
--- /dev/null
+++ b/cpp/demo/IceDiscovery/hello/HelloI.cpp
@@ -0,0 +1,31 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2013 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 <IceUtil/IceUtil.h>
+#include <Ice/Ice.h>
+#include <HelloI.h>
+
+using namespace std;
+
+void
+HelloI::sayHello(int delay, const Ice::Current&)
+{
+ if(delay != 0)
+ {
+ IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(delay));
+ }
+ cout << "Hello World!" << endl;
+}
+
+void
+HelloI::shutdown(const Ice::Current& c)
+{
+ cout << "Shutting down..." << endl;
+ c.adapter->getCommunicator()->shutdown();
+}