aboutsummaryrefslogtreecommitdiff
path: root/include/sibs
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-06-08 03:06:07 +0200
committerdec05eba <dec05eba@protonmail.com>2020-08-18 22:56:48 +0200
commit824e669ddb12f1c30074c84eb731fa598f92ccfa (patch)
treede9b890e90db431453d840cf65415eb97e6c876d /include/sibs
parent8f9e965be28376c3034b33fd545b428f44fa70a0 (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;
};
}