Compare commits

..

17 Commits

Author SHA1 Message Date
Richard Holland
197c9507f9 clang 2024-12-11 12:28:08 +11:00
Richard Holland
9266db8afc - 2024-12-11 12:08:48 +11:00
Richard Holland
96e6241cf4 - 2024-12-11 12:04:56 +11:00
Richard Holland
8c5adaf8c6 reduce max payload 2024-12-11 12:02:26 +11:00
Richard Holland
8e5b781f1b remove debug msgs 2024-12-11 11:50:27 +11:00
RichardAH
91c21a6605 Merge branch 'dev' into udp 2024-12-11 10:34:19 +10:00
Richard Holland
d52f041cd6 fixReduceImport (#398)
Co-authored-by: Denis Angell <dangell@transia.co>
2024-12-11 11:31:45 +11:00
RichardAH
98818dd6b6 Datagram monitor (#400)
Co-authored-by: Denis Angell <dangell@transia.co>
2024-12-11 09:38:16 +10:00
Denis Angell
3879c529c1 Fix: failing assert (#397) 2024-11-28 19:20:44 +10:00
Ekiserrepé
a05d58a6e9 Update README.md (#396)
Updated Xaman link.
2024-11-26 08:52:49 +10:00
RichardAH
0c822e102f Merge branch 'dev' into udp 2024-11-20 12:15:07 +10:00
Richard Holland
e671acfe5e udp subscriptions 2024-11-15 11:24:59 +11:00
Richard Holland
499d01df11 udp subscriptions draft 2024-11-15 09:45:22 +11:00
RichardAH
3a27ff5143 Merge branch 'dev' into udp 2024-11-15 08:38:44 +10:00
Richard Holland
082840fd76 preliminary subscription support (compiling with bug) 2024-11-13 13:38:45 +11:00
RichardAH
92a8cb0816 Merge branch 'dev' into udp 2024-11-13 10:47:04 +10:00
Richard Holland
18ba28f309 udp admin support 2024-11-13 11:35:59 +11:00
4 changed files with 10 additions and 21 deletions

View File

@@ -1527,7 +1527,7 @@ ApplicationImp::setup(boost::program_options::variables_map const& cmdline)
reportingETL_->start();
// Datagram monitor if applicable
if (!config_->standalone() && !config_->DATAGRAM_MONITOR.empty())
if (!config_->standalone() && config_->DATAGRAM_MONITOR != "")
{
datagram_monitor_ = std::make_unique<DatagramMonitor>(*this);
if (datagram_monitor_)

View File

@@ -996,24 +996,15 @@ private:
void
monitorThread()
{
std::vector<std::pair<EndpointInfo, int>> endpoints;
for (auto const& epStr : app_.config().DATAGRAM_MONITOR)
{
auto endpoint = parseEndpoint(epStr);
endpoints.push_back(
std::make_pair(endpoint, createSocket(endpoint)));
}
auto endpoint = parseEndpoint(app_.config().DATAGRAM_MONITOR);
int sock = createSocket(endpoint);
while (running_)
{
try
{
auto info = generateServerInfo();
for (auto const& ep : endpoints)
{
sendPacket(ep.second, ep.first, info);
}
sendPacket(sock, endpoint, info);
std::this_thread::sleep_for(std::chrono::seconds(1));
}
catch (const std::exception& e)
@@ -1024,10 +1015,7 @@ private:
}
}
for (auto const& ep : endpoints)
{
close(ep.second);
}
close(sock);
}
public:

View File

@@ -155,7 +155,7 @@ public:
std::map<std::string, PublicKey>
IMPORT_VL_KEYS; // hex string -> class PublicKey (for caching purposes)
std::vector<std::string> DATAGRAM_MONITOR;
std::string DATAGRAM_MONITOR;
enum StartUpType {
FRESH,

View File

@@ -510,10 +510,11 @@ Config::loadFromString(std::string const& fileContents)
NETWORK_ID = beast::lexicalCastThrow<uint32_t>(strTemp);
}
if (auto s = getIniFileSection(secConfig, SECTION_DATAGRAM_MONITOR))
if (getSingleSection(secConfig, SECTION_DATAGRAM_MONITOR, strTemp, j_))
{
DATAGRAM_MONITOR = *s;
replaceColons(DATAGRAM_MONITOR);
std::vector<std::string> vecTemp{strTemp};
replaceColons(vecTemp);
DATAGRAM_MONITOR = vecTemp[0];
}
if (getSingleSection(secConfig, SECTION_PEER_PRIVATE, strTemp, j_))