From 240edf7494745dc4df2128644fe5c1a73ec2d513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 29 Feb 2020 20:38:38 +0100 Subject: Network: service interface and handling --- src/network.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/network.h') diff --git a/src/network.h b/src/network.h index 13bb031..9b146a9 100644 --- a/src/network.h +++ b/src/network.h @@ -21,6 +21,7 @@ using std::thread; using std::unique_ptr; using std::variant; using std::vector; +using std::tuple; using std::weak_ptr; using std::enable_shared_from_this; @@ -31,6 +32,7 @@ using chrono::steady_clock; namespace erebos { class ReplyBuilder; +struct WaitingRef; struct Server::Peer { @@ -53,11 +55,14 @@ struct Server::Peer Storage tempStorage; PartialStorage partStorage; + vector>> serviceQueue {}; + shared_ptr lpeer = nullptr; void send(const struct TransportHeader &, const vector &) const; void updateIdentity(ReplyBuilder &); void updateChannel(ReplyBuilder &); + void updateService(ReplyBuilder &); }; struct Peer::Priv : enable_shared_from_this @@ -94,7 +99,7 @@ struct TransportHeader struct Item { const Type type; - const variant value; + const variant value; }; TransportHeader(const vector & items): items(items) {} @@ -131,7 +136,7 @@ struct WaitingRef struct Server::Priv { - Priv(const Identity & self); + Priv(const Identity & self, vector> && svcs); ~Priv(); void doListen(); void doAnnounce(); @@ -147,6 +152,8 @@ struct Server::Priv bool finish = false; Identity self; + vector> services; + thread threadListen; thread threadAnnounce; -- cgit v1.2.3