Revision: 41767
          http://brlcad.svn.sourceforge.net/brlcad/?rev=41767&view=rev
Author:   davidloman
Date:     2010-12-22 14:27:32 +0000 (Wed, 22 Dec 2010)

Log Message:
-----------
Clean up PingMsg/PongMsg handling logic a bit.

Modified Paths:
--------------
    rt^3/trunk/src/GS/GSClient.cxx
    rt^3/trunk/src/GS/GeometryService.cxx

Modified: rt^3/trunk/src/GS/GSClient.cxx
===================================================================
--- rt^3/trunk/src/GS/GSClient.cxx      2010-12-22 14:20:37 UTC (rev 41766)
+++ rt^3/trunk/src/GS/GSClient.cxx      2010-12-22 14:27:32 UTC (rev 41767)
@@ -115,6 +115,7 @@
                        } else {
                                log->logINFO("GSClient", "Can't return ping.  
NULL Portal*");
                        }
+                       return true;
                }
        case PONG:
                {
@@ -126,17 +127,14 @@
                        quint64 now = Logger::getCurrentTime();
                        quint64 diff = now -start;
 
-                       log->logINFO("GSClient", "Start: " + 
QString::number(start) +
-                                       ", now: " + QString::number(now) +
-                                       ", diff: " + QString::number(diff) );
+                       QString time = "roundtrip time: " + 
QString::number(diff) + "ms.";
+                       QString remNodeName = "unknown";
 
                        if (p != NULL) {
-                               QString remNodeName = p->getRemoteNodeName();
-                               log->logINFO("GSClient", "Pong from: '" + 
remNodeName + "'");
-                       } else {
-                               log->logINFO("GSClient", "Can't return ping.  
NULL Portal*");
+                               remNodeName = p->getRemoteNodeName();
                        }
 
+                       log->logINFO("GSClient", "Pong from: '" + remNodeName + 
"', " + time);
                        return true;
                }
        }

Modified: rt^3/trunk/src/GS/GeometryService.cxx
===================================================================
--- rt^3/trunk/src/GS/GeometryService.cxx       2010-12-22 14:20:37 UTC (rev 
41766)
+++ rt^3/trunk/src/GS/GeometryService.cxx       2010-12-22 14:27:32 UTC (rev 
41767)
@@ -136,6 +136,26 @@
 
                        return true;
                }
+       case PONG:
+               {
+                       Portal* p = msg->getOrigin();
+                       PongMsg* pongMsg = (PongMsg*)msg;
+
+                       /* calc current and differential times */
+                       quint64 start = pongMsg->getStartTime();
+                       quint64 now = Logger::getCurrentTime();
+                       quint64 diff = now -start;
+
+                       QString time = "roundtrip time: " + 
QString::number(diff) + "ms.";
+                       QString remNodeName = "unknown";
+
+                       if (p != NULL) {
+                               remNodeName = p->getRemoteNodeName();
+                       }
+
+                       log->logINFO("GSClient", "Pong from: '" + remNodeName + 
"', " + time);
+                       return true;
+               }
        }
        return false;
 }


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

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your 
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to