Revision: 41731
http://brlcad.svn.sourceforge.net/brlcad/?rev=41731&view=rev
Author: davidloman
Date: 2010-12-20 21:10:10 +0000 (Mon, 20 Dec 2010)
Log Message:
-----------
Implement Ping and Pong Msgs. Will be used for heartbeat/keepalive and network
latency measuring.
Modified Paths:
--------------
rt^3/trunk/include/NetMsgTypes.h
rt^3/trunk/src/libNet/CMakeLists.txt
Added Paths:
-----------
rt^3/trunk/include/PingMsg.h
rt^3/trunk/include/PongMsg.h
rt^3/trunk/src/libNet/netMsg/PingMsg.cxx
rt^3/trunk/src/libNet/netMsg/PongMsg.cxx
Modified: rt^3/trunk/include/NetMsgTypes.h
===================================================================
--- rt^3/trunk/include/NetMsgTypes.h 2010-12-20 20:59:39 UTC (rev 41730)
+++ rt^3/trunk/include/NetMsgTypes.h 2010-12-20 21:10:10 UTC (rev 41731)
@@ -40,6 +40,9 @@
#define FAILURE 0x0050
#define SUCCESS 0x0051
+#define PING
0x0060
+#define PONG 0x0062
+
#define GS_REMOTE_NODENAME_SET 0x0100
#define DISCONNECTREQ 0x0150
Added: rt^3/trunk/include/PingMsg.h
===================================================================
--- rt^3/trunk/include/PingMsg.h (rev 0)
+++ rt^3/trunk/include/PingMsg.h 2010-12-20 21:10:10 UTC (rev 41731)
@@ -0,0 +1,52 @@
+/* P I N G M S G . H
+ * BRL-CAD
+ *
+ * Copyright (c) 2010 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+/** @file PingMsg.h
+ * PingMsg.h
+ *
+ * Created on: Dec 20, 2010
+ */
+
+#ifndef __PINGMSG_H__
+#define __PINGMSG_H__
+
+#include "GenericFourBytesMsg.h"
+#include <QtCore/QString>
+
+class PingMsg: public GenericFourBytesMsg {
+public:
+ PingMsg(quint32 startT);
+ virtual ~PingMsg();
+
+ quint32 getStartTime();
+
+
+};
+
+#endif /* __PINGMSG_H__ */
+
+/*
+ * Local Variables:
+ * tab-width: 8
+ * mode: C
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */
Property changes on: rt^3/trunk/include/PingMsg.h
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Added: rt^3/trunk/include/PongMsg.h
===================================================================
--- rt^3/trunk/include/PongMsg.h (rev 0)
+++ rt^3/trunk/include/PongMsg.h 2010-12-20 21:10:10 UTC (rev 41731)
@@ -0,0 +1,40 @@
+/* P O N G M S G . H
+ * BRL-CAD
+ *
+ * Copyright (c) 2010 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+/** @file PongMsg.h
+ * PongMsg.h
+ *
+ * Created on: Dec 20, 2010
+ */
+
+#ifndef PONGMSG_H_
+#define PONGMSG_H_
+
+#include "PingMsg.h"
+#include "GenericFourBytesMsg.h"
+
+class PongMsg: public GenericFourBytesMsg {
+public:
+ PongMsg(PingMsg* ping);
+ virtual ~PongMsg();
+
+ quint32 getStartTime();
+};
+
+#endif /* PONGMSG_H_ */
Property changes on: rt^3/trunk/include/PongMsg.h
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Modified: rt^3/trunk/src/libNet/CMakeLists.txt
===================================================================
--- rt^3/trunk/src/libNet/CMakeLists.txt 2010-12-20 20:59:39 UTC (rev
41730)
+++ rt^3/trunk/src/libNet/CMakeLists.txt 2010-12-20 21:10:10 UTC (rev
41731)
@@ -66,6 +66,8 @@
netMsg/GeometryReqMsg.cxx
netMsg/GeometryManifestMsg.cxx
netMsg/GeometryChunkMsg.cxx
+ netMsg/PingMsg.cxx
+ netMsg/PongMsg.cxx
RouteMsgJob.cxx
)
@@ -93,6 +95,8 @@
GeometryReqMsg.h
GeometryManifestMsg.h
GeometryChunkMsg.h
+ PingMsg.h
+ PongMsg.h
RouteMsgJob.h
)
Added: rt^3/trunk/src/libNet/netMsg/PingMsg.cxx
===================================================================
--- rt^3/trunk/src/libNet/netMsg/PingMsg.cxx (rev 0)
+++ rt^3/trunk/src/libNet/netMsg/PingMsg.cxx 2010-12-20 21:10:10 UTC (rev
41731)
@@ -0,0 +1,51 @@
+/* P I N G M S G . C X X
+ * BRL-CAD
+ *
+ * Copyright (c) 2010 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+/** @file PingMsg.cxx
+ * PingMsg.cxx
+ *
+ * Created on: Dec 20, 2010
+ */
+
+#include "NetMsgTypes.h"
+#include "PingMsg.h"
+#include <sys/time.h>
+
+PingMsg::PingMsg(quint32 startT):GenericFourBytesMsg(PONG, startT) {
+}
+
+PingMsg::~PingMsg() {
+}
+
+quint32
+PingMsg::getStartTime()
+{
+ return this->data;
+}
+
+
+/*
+ * Local Variables:
+ * tab-width: 8
+ * mode: C
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */
Property changes on: rt^3/trunk/src/libNet/netMsg/PingMsg.cxx
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Added: rt^3/trunk/src/libNet/netMsg/PongMsg.cxx
===================================================================
--- rt^3/trunk/src/libNet/netMsg/PongMsg.cxx (rev 0)
+++ rt^3/trunk/src/libNet/netMsg/PongMsg.cxx 2010-12-20 21:10:10 UTC (rev
41731)
@@ -0,0 +1,48 @@
+/* P O N G M S G . C X X
+ * BRL-CAD
+ *
+ * Copyright (c) 2010 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+/** @file PongMsg.cxx
+ * PongMsg.cxx
+ *
+ * Created on: Dec 20, 2010
+ */
+
+#include "NetMsgTypes.h"
+#include "PongMsg.h"
+
+PongMsg::PongMsg(PingMsg* ping) : GenericFourBytesMsg(PING,
ping->getStartTime()){
+}
+
+PongMsg::~PongMsg() {
+}
+
+quint32
+PongMsg::getStartTime(){
+ return this->data;
+}
+
+/*
+ * Local Variables:
+ * tab-width: 8
+ * mode: C
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */
Property changes on: rt^3/trunk/src/libNet/netMsg/PongMsg.cxx
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
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