diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-10-16 00:37:21 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-08-18 22:56:48 +0200 |
commit | c47870421f189eb98fc66e912693d73fbd8477ee (patch) | |
tree | 036ead590fa17bef279de483489a880c54ef4ba1 /include/sibs/BootstrapNode.hpp | |
parent | 0c1b3db7c4d9a4bcde4160c437613b32cd4081d6 (diff) |
Reuse peer connection if subscribed to same key
Diffstat (limited to 'include/sibs/BootstrapNode.hpp')
-rw-r--r-- | include/sibs/BootstrapNode.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/sibs/BootstrapNode.hpp b/include/sibs/BootstrapNode.hpp index ab3d6b3..c824a84 100644 --- a/include/sibs/BootstrapNode.hpp +++ b/include/sibs/BootstrapNode.hpp @@ -1,5 +1,6 @@ #pragma once +#include "Socket.hpp" #include "DirectConnection.hpp" #include "IpAddress.hpp" #include "PubsubKey.hpp" @@ -23,10 +24,10 @@ namespace sibs ~BootstrapNode(); private: void acceptConnections(); - void peerSubscribe(std::shared_ptr<DirectConnectionPeer> peer, const void *data, const usize size); + void messageFromClient(std::shared_ptr<DirectConnectionPeer> peer, MessageType messageType, const void *data, const usize size); private: DirectConnections connections; - int socket; + std::unique_ptr<Socket> socket; std::thread acceptConnectionsThread; PubsubKeyMap<std::vector<std::shared_ptr<DirectConnectionPeer>>> subscribedPeers; std::mutex subscribedPeersMutex; |