etch-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vei...@apache.org
Subject svn commit: r1578906 - /etch/trunk/examples/helloworld/cpp/src/main/include/ImplHelloWorldServer.h
Date Tue, 18 Mar 2014 14:01:00 GMT
Author: veithm
Date: Tue Mar 18 14:01:00 2014
New Revision: 1578906

URL: http://svn.apache.org/r1578906
Log:
Adding _sessionNotify to server side helloWorld example

The _sessionNotify function has been added to the HelloWorldServer
implemenation. This code shows how to handle events from the stack on the
server implementation side.

Change-Id: Ic3089b2a3b5b9f96f6ef353a4461f04e7c6e844a

Modified:
    etch/trunk/examples/helloworld/cpp/src/main/include/ImplHelloWorldServer.h

Modified: etch/trunk/examples/helloworld/cpp/src/main/include/ImplHelloWorldServer.h
URL: http://svn.apache.org/viewvc/etch/trunk/examples/helloworld/cpp/src/main/include/ImplHelloWorldServer.h?rev=1578906&r1=1578905&r2=1578906&view=diff
==============================================================================
--- etch/trunk/examples/helloworld/cpp/src/main/include/ImplHelloWorldServer.h (original)
+++ etch/trunk/examples/helloworld/cpp/src/main/include/ImplHelloWorldServer.h Tue Mar 18
14:01:00 2014
@@ -39,6 +39,19 @@ namespace org_apache_etch_examples_hello
     // messages from the mClient.
     say_helloAsyncResultPtr say_hello(HelloWorld::userPtr to_whom);
 
+    virtual status_t _sessionNotify(capu::SmartPointer<EtchObject> event ) {
+        if (event->getObjectType() == EtchString::TYPE()) {
+            capu::SmartPointer<EtchString> myEvent = capu::smartpointer_cast<EtchString>(event);
+            if (myEvent->equals(&EtchSession::DOWN())) {
+                //client has closed session
+            }
+            if (myEvent->equals(&EtchSession::UP())) {
+                //session to client has been established
+            }
+        }
+        return ETCH_OK;
+    }
+
   };
 }
 



Mime
View raw message