aboutsummaryrefslogtreecommitdiff
path: root/include/sibs
diff options
context:
space:
mode:
authordec05eba <0xdec05eba@gmail.com>2018-06-08 03:06:07 +0200
committerdec05eba <0xdec05eba@gmail.com>2018-06-08 03:06:09 +0200
commitfa911f5dd666eb01eabf898f071ca57933bc110f (patch)
treefe76ffa191bef6d5c0fce37ebc21648c33768a1a /include/sibs
parentb4eeb4aa9488daf578f49a3012da1d8d0d5c98e0 (diff)
Add put method
Diffstat (limited to 'include/sibs')
-rw-r--r--include/sibs/BootstrapConnection.hpp4
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;
};
}