Revision: 40755
          http://brlcad.svn.sourceforge.net/brlcad/?rev=40755&view=rev
Author:   davidloman
Date:     2010-09-28 18:38:35 +0000 (Tue, 28 Sep 2010)

Log Message:
-----------
Introduce RUALIVE and IMALIVE message types.  Make Portal respond to RUALIVE 
with an IMALIVE msg.

Modified Paths:
--------------
    rt^3/trunk/include/NetMsgTypes.h
    rt^3/trunk/src/libNet/NetMsgFactory.cxx
    rt^3/trunk/src/libNet/Portal.cxx
    rt^3/trunk/tests/libNet/libNetTest.cxx

Modified: rt^3/trunk/include/NetMsgTypes.h
===================================================================
--- rt^3/trunk/include/NetMsgTypes.h    2010-09-28 18:34:47 UTC (rev 40754)
+++ rt^3/trunk/include/NetMsgTypes.h    2010-09-28 18:38:35 UTC (rev 40755)
@@ -34,7 +34,8 @@
 #define        TEST_GENERIC_MULTIBYTE_MSG              0x0023
 #define        TEST_GENERIC_1STRING_MSG                0x0024
 
-#define        KEEPALIVE                                       0x0042
+#define        RUALIVE                                 0x0042
+#define        IMALIVE                                 0x0043
 
 #define        FAILURE                                 0x0050
 #define        SUCCESS                         0x0051

Modified: rt^3/trunk/src/libNet/NetMsgFactory.cxx
===================================================================
--- rt^3/trunk/src/libNet/NetMsgFactory.cxx     2010-09-28 18:34:47 UTC (rev 
40754)
+++ rt^3/trunk/src/libNet/NetMsgFactory.cxx     2010-09-28 18:38:35 UTC (rev 
40755)
@@ -103,8 +103,10 @@
   case TEST_GENERIC_1STRING_MSG:
     return new GenericOneStringMsg(qds, origin);
 
-  case KEEPALIVE:
-    return new GenericOneByteMsg(qds, origin);
+  case RUALIVE:
+    return new TypeOnlyMsg(qds, origin);
+  case IMALIVE:
+    return new TypeOnlyMsg(qds, origin);
 
   case FAILURE:
     return new GenericOneByteMsg(qds, origin);

Modified: rt^3/trunk/src/libNet/Portal.cxx
===================================================================
--- rt^3/trunk/src/libNet/Portal.cxx    2010-09-28 18:34:47 UTC (rev 40754)
+++ rt^3/trunk/src/libNet/Portal.cxx    2010-09-28 18:38:35 UTC (rev 40755)
@@ -147,6 +147,11 @@
                }
                delete msg;
                return true;
+       } else if (type == RUALIVE) {
+               TypeOnlyMsg tom(IMALIVE);
+               p->send(&tom);
+               delete msg;
+               return true;
        }
 
        return false;

Modified: rt^3/trunk/tests/libNet/libNetTest.cxx
===================================================================
--- rt^3/trunk/tests/libNet/libNetTest.cxx      2010-09-28 18:34:47 UTC (rev 
40754)
+++ rt^3/trunk/tests/libNet/libNetTest.cxx      2010-09-28 18:38:35 UTC (rev 
40755)
@@ -143,7 +143,10 @@
                Portal* p = pm.connectToHost(t, port);
 
                if (p != 0) {
-                       GSThread::sleep(10);
+                       GSThread::sleep(2);
+                       TypeOnlyMsg tom(RUALIVE);
+                       p->send(&tom);
+                       GSThread::sleep(1);
                }
 
                GSThread::sleep(1);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to