Revision: 41614
          http://brlcad.svn.sourceforge.net/brlcad/?rev=41614&view=rev
Author:   davidloman
Date:     2010-12-15 14:54:35 +0000 (Wed, 15 Dec 2010)

Log Message:
-----------
Put in a 'send then disconnect' function.  Reduces repetitive code in many 
areas.

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

Modified: rt^3/trunk/include/Portal.h
===================================================================
--- rt^3/trunk/include/Portal.h 2010-12-15 14:33:10 UTC (rev 41613)
+++ rt^3/trunk/include/Portal.h 2010-12-15 14:54:35 UTC (rev 41614)
@@ -44,6 +44,7 @@
   friend class PortalManager;
   virtual ~Portal();
   int send(NetMsg* msg);
+  int sendThenDisconnect(NetMsg* msg);
   void sendGSNodeName();
   void disconnect();
 

Modified: rt^3/trunk/src/libNet/Portal.cxx
===================================================================
--- rt^3/trunk/src/libNet/Portal.cxx    2010-12-15 14:33:10 UTC (rev 41613)
+++ rt^3/trunk/src/libNet/Portal.cxx    2010-12-15 14:54:35 UTC (rev 41614)
@@ -64,7 +64,16 @@
        delete ba;
        return retval;
 }
+int
+Portal::sendThenDisconnect(NetMsg* msg) {
+       int retval = this->send(msg);
 
+       /* TODO should we check to see if send actually sends first? */
+       this->disconnect();
+
+       return retval;
+}
+
 void
 Portal::sendGSNodeName() {
        QString localNodeName = Config::getInstance()->getConfigValue(


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

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to