Merge pull request from G10h4ck/broadcast_discovery

Broadcast Domain friends IP:Port Discovery
This commit is contained in:
G10h4ck 2019-04-23 17:18:54 +02:00 committed by GitHub
commit 9a7ce1ae72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 1118 additions and 108 deletions
libretroshare/src/rsserver

View file

@ -39,6 +39,9 @@ int rsserverzone = 101;
#include "util/rsdebug.h"
#include "retroshare/rsevents.h"
#include "services/rseventsservice.h"
/****
#define DEBUG_TICK 1
@ -81,6 +84,12 @@ RsServer::RsServer() :
coreMutex("RsServer"), mShutdownCallback([](int){}),
coreReady(false)
{
{
RsEventsService* tmpRsEvtPtr = new RsEventsService();
rsEvents.reset(tmpRsEvtPtr);
startServiceThread(tmpRsEvtPtr, "RsEventsService");
}
// This is needed asap.
//
mNotify = new p3Notify() ;

View file

@ -34,7 +34,7 @@
#ifdef __ANDROID__
# include <QFile> // To install bdboot.txt
# include <QString> // for String::fromStdString(...)
# include <QString> // for QString::fromStdString(...)
#endif
#include "util/argstream.h"
@ -98,6 +98,11 @@ RsDht *rsDht = NULL ;
# include "jsonapi/jsonapi.h"
#endif
#ifdef RS_BROADCAST_DISCOVERY
# include "retroshare/rsbroadcastdiscovery.h"
# include "services/broadcastdiscoveryservice.h"
#endif // def RS_BROADCAST_DISCOVERY
// #define GPG_DEBUG
// #define AUTHSSL_DEBUG
// #define FIM_DEBUG
@ -1454,6 +1459,12 @@ int RsServer::StartupRetroShare()
mHistoryMgr, *mGxsTrans );
mStatusSrv = new p3StatusService(serviceCtrl);
#ifdef RS_BROADCAST_DISCOVERY
rsBroadcastDiscovery.reset(new BroadcastDiscoveryService(*rsPeers));
BroadcastDiscoveryService& tBroadcastDiscoveryService =
static_cast<BroadcastDiscoveryService&>(*rsBroadcastDiscovery);
#endif // def RS_BROADCAST_DISCOVERY
#ifdef ENABLE_GROUTER
p3GRouter *gr = new p3GRouter(serviceCtrl,mGxsIdService) ;
rsGRouter = gr ;
@ -1841,10 +1852,14 @@ int RsServer::StartupRetroShare()
# ifdef RS_GXS_TRANS
startServiceThread(mGxsTrans, "gxs trans");
startServiceThread(gxstrans_ns, "gxs trans ns");
# endif // RS_GXS_TRANS
# endif // def RS_GXS_TRANS
#endif // RS_ENABLE_GXS
#ifdef RS_BROADCAST_DISCOVERY
startServiceThread(&tBroadcastDiscoveryService, "Broadcast Discovery");
#endif // def RS_BROADCAST_DISCOVERY
ftserver->StartupThreads();
ftserver->ResumeTransfers();