[brlcad-commits] SF.net SVN: brlcad:[37448]
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <dav...@us...> - 2010-01-27 13:58:42
|
Revision: 37448 http://brlcad.svn.sourceforge.net/brlcad/?rev=37448&view=rev Author: davidloman Date: 2010-01-27 13:58:36 +0000 (Wed, 27 Jan 2010) Log Message: ----------- D-lo: Fixed some includes issues. Modified Paths: -------------- rt^3/trunk/include/GS/NetSockPortal.h rt^3/trunk/include/GS/NetSockPortalManager.h rt^3/trunk/src/GS/NetSockPortal.cxx rt^3/trunk/src/GS/NetSockPortalManager.cxx Modified: rt^3/trunk/include/GS/NetSockPortal.h =================================================================== --- rt^3/trunk/include/GS/NetSockPortal.h 2010-01-27 10:23:17 UTC (rev 37447) +++ rt^3/trunk/include/GS/NetSockPortal.h 2010-01-27 13:58:36 UTC (rev 37448) @@ -26,20 +26,23 @@ #ifndef __NETSOCKPORTAL_H__ #define __NETSOCKPORTAL_H__ +#include <QTcpServer> #include <QTcpSocket> #include <QString> #include "GE/Logger.h" #include "GS/netMsg/NetMsgFactory.h" +class NetSockPortalManager; + class NetSockPortal: public QTcpSocket { - Q_OBJECT +Q_OBJECT - friend class NetSockPortalManager; +friend class NetSockPortalManager; public: - NetSockPortal(QObject* parent = 0); + NetSockPortal(NetSockPortalManager* parent); virtual ~NetSockPortal(); bool hasMsg(); @@ -55,12 +58,12 @@ NotConnected = 0, Handshaking = 5, Ready = 10, Failed = 15, }; -signals: + signals: void msgReady(); void portalHandshakeComplete(); protected slots: - void moveDataFromSocketBuffer(); +void moveDataFromSocketBuffer(); private: QString remHostName; @@ -70,6 +73,8 @@ int portStatus; + NetSockPortalManager* nspm; + }; #endif Modified: rt^3/trunk/include/GS/NetSockPortalManager.h =================================================================== --- rt^3/trunk/include/GS/NetSockPortalManager.h 2010-01-27 10:23:17 UTC (rev 37447) +++ rt^3/trunk/include/GS/NetSockPortalManager.h 2010-01-27 13:58:36 UTC (rev 37448) @@ -35,6 +35,7 @@ #include <QList> #include <QByteArray> + class NetSockPortalManager: public QTcpServer { Q_OBJECT Modified: rt^3/trunk/src/GS/NetSockPortal.cxx =================================================================== --- rt^3/trunk/src/GS/NetSockPortal.cxx 2010-01-27 10:23:17 UTC (rev 37447) +++ rt^3/trunk/src/GS/NetSockPortal.cxx 2010-01-27 13:58:36 UTC (rev 37448) @@ -27,13 +27,15 @@ #include "GS/GSCommon.h" #include "GS/netMsg/NetMsg.h" #include "GS/netMsg/RemHostNameSetMsg.h" +#include "GS/NetSockPortalManager.h" #include <QHostAddress> -NetSockPortal::NetSockPortal(QObject* parent) : - QTcpSocket(parent) +NetSockPortal::NetSockPortal(NetSockPortalManager* nspm) : + QTcpSocket() { this->log = Logger::getInstance(); + this->nspm = nspm; QObject::connect(this, SIGNAL(readyRead()), this, SLOT( moveDataFromSocketBuffer())); @@ -94,12 +96,13 @@ return; } -// //If the nspm returns a NetSockPortal object, then this host is already on the network! -// if (this->nspm->getPortalByRemHostname(remoteHostname) != NULL) -// { -// this->disconnect(PORTAL_HANDSHAKE_FAILURE); -// return; -// } + //If the nspm returns a NetSockPortal object, then this host is already on the network! + if (this->nspm->getPortalByRemHostname(remoteHostname) + != NULL) + { + this->disconnect(PORTAL_HANDSHAKE_FAILURE); + return; + } this->remHostName = remoteHostname; this->portStatus = NetSockPortal::Ready; Modified: rt^3/trunk/src/GS/NetSockPortalManager.cxx =================================================================== --- rt^3/trunk/src/GS/NetSockPortalManager.cxx 2010-01-27 10:23:17 UTC (rev 37447) +++ rt^3/trunk/src/GS/NetSockPortalManager.cxx 2010-01-27 13:58:36 UTC (rev 37448) @@ -60,7 +60,7 @@ NetSockPortal* NetSockPortalManager::preparePortal() { //Create new NSP and setup signals - NetSockPortal* nsp = new NetSockPortal(); + NetSockPortal* nsp = new NetSockPortal(this); //Set up signal prior to initializing the NSP with a socket Descriptor QObject::connect(nsp, SIGNAL(portalHandshakeComplete()), this, SLOT( @@ -105,7 +105,7 @@ NetSockPortal* nsp = (NetSockPortal*) sender(); //Map the NSP - this->portalList->insert(nsp->getRemoteHostName(), nsp); + NetSockPortalManager::portalList->insert(nsp->getRemoteHostName(), nsp); QObject::disconnect(nsp, SIGNAL(portalHandshakeComplete()), this, SLOT( handlePortalHandshakeCompleted())); @@ -120,7 +120,7 @@ NetSockPortal* nsp = (NetSockPortal*) sender(); //Map the NSP - this->portalList->remove(nsp->getRemoteHostName()); + NetSockPortalManager::portalList->remove(nsp->getRemoteHostName()); } void NetSockPortalManager::sendLocalHostName(NetSockPortal* nsp) @@ -131,7 +131,7 @@ NetSockPortal* NetSockPortalManager::getPortalByRemHostname(QString remHostName) { - return this->portalList->value(remHostName, NULL); + return NetSockPortalManager::portalList->value(remHostName, NULL); } // Local Variables: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |