mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-22 07:41:20 -04:00
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:
parent
efe9503c3a
commit
190988c3cc
33 changed files with 387 additions and 329 deletions
|
@ -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();
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue