diff options
author | dec05eba <0xdec05eba@gmail.com> | 2018-06-08 03:06:07 +0200 |
---|---|---|
committer | dec05eba <0xdec05eba@gmail.com> | 2018-06-08 03:06:09 +0200 |
commit | fa911f5dd666eb01eabf898f071ca57933bc110f (patch) | |
tree | fe76ffa191bef6d5c0fce37ebc21648c33768a1a /include/sibs | |
parent | b4eeb4aa9488daf578f49a3012da1d8d0d5c98e0 (diff) |
Add put method
Diffstat (limited to 'include/sibs')
-rw-r--r-- | include/sibs/BootstrapConnection.hpp | 4 |
1 files changed, 4 insertions, 0 deletions
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 <mutex> 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<std::vector<u8>> data); private: void receiveDataFromServer(std::shared_ptr<DirectConnectionPeer> peer, const void *data, const usize size); void receiveDataFromPeer(BoostrapConnectionListenCallbackFunc listenCallbackFunc, std::shared_ptr<DirectConnectionPeer> peer, const void *data, const usize size); @@ -29,5 +31,7 @@ namespace sibs DirectConnections connections; std::shared_ptr<DirectConnectionPeer> serverPeer; PubsubKeyMap<BoostrapConnectionListenCallbackFunc> listenCallbackFuncs; + PubsubKeyMap<std::vector<std::shared_ptr<DirectConnectionPeer>>> subscribedPeers; + std::mutex listenerCallbackFuncMutex; }; } |