From fa911f5dd666eb01eabf898f071ca57933bc110f Mon Sep 17 00:00:00 2001 From: dec05eba <0xdec05eba@gmail.com> Date: Fri, 8 Jun 2018 03:06:07 +0200 Subject: Add put method --- include/sibs/BootstrapConnection.hpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/sibs') diff --git a/include/sibs/BootstrapConnection.hpp b/include/sibs/BootstrapConnection.hpp index 964d777..094ee32 100644 --- a/include/sibs/BootstrapConnection.hpp +++ b/include/sibs/BootstrapConnection.hpp @@ -3,6 +3,7 @@ #include "../utils.hpp" #include "DirectConnection.hpp" #include "PubsubKey.hpp" +#include namespace sibs { @@ -22,6 +23,7 @@ namespace sibs // Throws PubsubKeyAlreadyListeningException if we are already listening on the key @pubsubKey void listen(const PubsubKey &pubsubKey, BoostrapConnectionListenCallbackFunc callbackFunc); + void put(const PubsubKey &pubsubKey, std::shared_ptr> data); private: void receiveDataFromServer(std::shared_ptr peer, const void *data, const usize size); void receiveDataFromPeer(BoostrapConnectionListenCallbackFunc listenCallbackFunc, std::shared_ptr peer, const void *data, const usize size); @@ -29,5 +31,7 @@ namespace sibs DirectConnections connections; std::shared_ptr serverPeer; PubsubKeyMap listenCallbackFuncs; + PubsubKeyMap>> subscribedPeers; + std::mutex listenerCallbackFuncMutex; }; } -- cgit v1.2.3