aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-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;
};
}