Switched most of the services to use p3ServiceControl instead of p3LinkMgr.

- Added a couple of utility fns to p3ServiceControl too.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7211 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2014-03-29 03:57:44 +00:00
parent efe9503c3a
commit 190988c3cc
33 changed files with 387 additions and 329 deletions

View file

@ -84,7 +84,7 @@ void RsGxsNetService::syncWithPeers()
{
std::set<RsPeerId> peers;
mNetMgr->getOnlineList(peers);
mNetMgr->getOnlineList(mServiceInfo.mServiceType, peers);
std::set<RsPeerId>::iterator sit = peers.begin();

View file

@ -24,6 +24,7 @@
*/
#include "rsgxsnetutils.h"
#include "pqi/p3servicecontrol.h"
#include "retroshare/rspeers.h"
@ -185,8 +186,8 @@ NxsTransaction::~NxsTransaction(){
/* Net Manager */
RsNxsNetMgrImpl::RsNxsNetMgrImpl(p3LinkMgr *lMgr)
: mLinkMgr(lMgr), mNxsNetMgrMtx("RsNxsNetMgrImpl")
RsNxsNetMgrImpl::RsNxsNetMgrImpl(p3ServiceControl *sc)
: mServiceCtrl(sc)
{
}
@ -194,24 +195,12 @@ RsNxsNetMgrImpl::RsNxsNetMgrImpl(p3LinkMgr *lMgr)
const RsPeerId& RsNxsNetMgrImpl::getOwnId()
{
RsStackMutex stack(mNxsNetMgrMtx);
return mLinkMgr->getOwnId();
return mServiceCtrl->getOwnId();
}
void RsNxsNetMgrImpl::getOnlineList(std::set<RsPeerId> &ssl_peers)
void RsNxsNetMgrImpl::getOnlineList(const uint32_t serviceId, std::set<RsPeerId> &ssl_peers)
{
ssl_peers.clear();
std::list<RsPeerId> pList;
{
RsStackMutex stack(mNxsNetMgrMtx);
mLinkMgr->getOnlineList(pList);
}
std::list<RsPeerId>::const_iterator lit = pList.begin();
for(; lit != pList.end(); lit++)
ssl_peers.insert(*lit);
mServiceCtrl->getPeersConnected(serviceId, ssl_peers);
}
const time_t GrpCircleVetting::EXPIRY_PERIOD_OFFSET = 5; // 10 seconds

View file

@ -28,10 +28,10 @@
#include <stdlib.h>
#include "retroshare/rsgxsifacetypes.h"
#include "pqi/p3linkmgr.h"
#include "serialiser/rsnxsitems.h"
#include "rsgixs.h"
class p3ServiceControl;
/*!
* This represents a transaction made
@ -82,7 +82,7 @@ public:
virtual ~RsNxsNetMgr(){};
virtual const RsPeerId& getOwnId() = 0;
virtual void getOnlineList(std::set<RsPeerId>& ssl_peers) = 0;
virtual void getOnlineList(const uint32_t serviceId, std::set<RsPeerId>& ssl_peers) = 0;
};
@ -91,16 +91,16 @@ class RsNxsNetMgrImpl : public RsNxsNetMgr
public:
RsNxsNetMgrImpl(p3LinkMgr* lMgr);
RsNxsNetMgrImpl(p3ServiceControl* sc);
virtual ~RsNxsNetMgrImpl(){};
const RsPeerId& getOwnId();
void getOnlineList(std::set<RsPeerId>& ssl_peers);
virtual const RsPeerId& getOwnId();
virtual void getOnlineList(const uint32_t serviceId, std::set<RsPeerId>& ssl_peers);
private:
p3LinkMgr* mLinkMgr;
RsMutex mNxsNetMgrMtx;
// No need for mutex as this is constant in the class.
p3ServiceControl* mServiceCtrl;
};