summaryrefslogtreecommitdiff
path: root/src/network.h
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2021-01-17 21:59:46 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2021-01-19 21:44:22 +0100
commit2abd6593c8b047d3fd579aa6cc0058bbebe266f8 (patch)
tree44af7148f648538846ef64bed0f8560f77de7e5d /src/network.h
parent1466751256580d8b0e6eea46a8028dcab9742f6b (diff)
Server watching local state head
Diffstat (limited to 'src/network.h')
-rw-r--r--src/network.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/network.h b/src/network.h
index 9b146a9..c02dbc3 100644
--- a/src/network.h
+++ b/src/network.h
@@ -136,7 +136,8 @@ struct WaitingRef
struct Server::Priv
{
- Priv(const Identity & self, vector<unique_ptr<Service>> && svcs);
+ Priv(const Head<LocalState> & local, const Identity & self,
+ vector<unique_ptr<Service>> && svcs);
~Priv();
void doListen();
void doAnnounce();
@@ -144,6 +145,8 @@ struct Server::Priv
Peer & getPeer(const sockaddr_in & paddr);
void handlePacket(Peer &, const TransportHeader &, ReplyBuilder &);
+ void handleLocalHeadChange(const Head<LocalState> &);
+
constexpr static uint16_t discoveryPort { 29665 };
constexpr static chrono::seconds announceInterval { 60 };
@@ -151,6 +154,7 @@ struct Server::Priv
condition_variable announceCondvar;
bool finish = false;
+ Head<LocalState> localHead;
Identity self;
vector<unique_ptr<Service>> services;