diff options
author | dec05eba <0xdec05eba@gmail.com> | 2018-06-08 04:16:48 +0200 |
---|---|---|
committer | dec05eba <0xdec05eba@gmail.com> | 2018-06-08 04:16:50 +0200 |
commit | e36509911c34a376c04498d47016002b1badbead (patch) | |
tree | 3c386074c82ce8cf6b7e2835ded40db12a5b013f /include/sibs/BootstrapConnection.hpp | |
parent | fa911f5dd666eb01eabf898f071ca57933bc110f (diff) |
Make connect asynchronous
Diffstat (limited to 'include/sibs/BootstrapConnection.hpp')
-rw-r--r-- | include/sibs/BootstrapConnection.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/sibs/BootstrapConnection.hpp b/include/sibs/BootstrapConnection.hpp index 094ee32..e77222d 100644 --- a/include/sibs/BootstrapConnection.hpp +++ b/include/sibs/BootstrapConnection.hpp @@ -7,6 +7,12 @@ namespace sibs { + class BootstrapConnectionException : public std::runtime_error + { + public: + BootstrapConnectionException(const std::string &errMsg) : std::runtime_error(errMsg) {} + }; + class PubsubKeyAlreadyListeningException : public std::runtime_error { public: @@ -19,6 +25,7 @@ namespace sibs { DISABLE_COPY(BootstrapConnection) public: + // Throws BootstrapConnectionException on error BootstrapConnection(const Ipv4 &bootstrapAddress); // Throws PubsubKeyAlreadyListeningException if we are already listening on the key @pubsubKey @@ -33,5 +40,6 @@ namespace sibs PubsubKeyMap<BoostrapConnectionListenCallbackFunc> listenCallbackFuncs; PubsubKeyMap<std::vector<std::shared_ptr<DirectConnectionPeer>>> subscribedPeers; std::mutex listenerCallbackFuncMutex; + std::mutex subscribedPeersMutex; }; } |