diff options
author | dec05eba <0xdec05eba@gmail.com> | 2018-10-21 14:30:44 +0200 |
---|---|---|
committer | dec05eba <0xdec05eba@gmail.com> | 2018-10-21 14:30:44 +0200 |
commit | 4fffc1cd8ccf1c3b1f15b2cb1942daf8cdd556ab (patch) | |
tree | 15076853892f8bdc07efedde22cfb4479e253a07 | |
parent | 1e1e4e0bbb9734e902e51339ebb8c274c2082e08 (diff) |
rename create -> connect
-rw-r--r-- | include/sibs/BootstrapConnection.hpp | 2 | ||||
-rw-r--r-- | src/BootstrapConnection.cpp | 2 | ||||
-rw-r--r-- | tests/main.cpp | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/include/sibs/BootstrapConnection.hpp b/include/sibs/BootstrapConnection.hpp index 790b7ee..1c5c1a5 100644 --- a/include/sibs/BootstrapConnection.hpp +++ b/include/sibs/BootstrapConnection.hpp @@ -42,7 +42,7 @@ namespace sibs DISABLE_COPY(BootstrapConnection) public: // Throws BootstrapConnectionException on error - static std::future<std::unique_ptr<BootstrapConnection>> create(const Ipv4 &bootstrapAddress); + static std::future<std::unique_ptr<BootstrapConnection>> connect(const Ipv4 &bootstrapAddress); ~BootstrapConnection(); // If we are already listening on the key @pubsubKey then the callback function is overwritten diff --git a/src/BootstrapConnection.cpp b/src/BootstrapConnection.cpp index c70fbc9..d7cee09 100644 --- a/src/BootstrapConnection.cpp +++ b/src/BootstrapConnection.cpp @@ -54,7 +54,7 @@ namespace sibs } } - std::future<std::unique_ptr<BootstrapConnection>> BootstrapConnection::create(const Ipv4 &bootstrapAddress) + std::future<std::unique_ptr<BootstrapConnection>> BootstrapConnection::connect(const Ipv4 &bootstrapAddress) { std::promise<std::unique_ptr<BootstrapConnection>> connectionPromise; std::future<std::unique_ptr<BootstrapConnection>> connectionFuture = connectionPromise.get_future(); diff --git a/tests/main.cpp b/tests/main.cpp index 7bb63e2..2623884 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -17,7 +17,7 @@ int main() bool connectionFailure = false; try { - sibs::BootstrapConnection::create(sibs::Ipv4("127.0.0.1", 2222)).get(); + sibs::BootstrapConnection::connect(sibs::Ipv4("127.0.0.1", 2222)).get(); } catch(sibs::BootstrapConnectionException &e) { @@ -25,7 +25,7 @@ int main() } REQUIRE(connectionFailure); - std::unique_ptr<sibs::BootstrapConnection> connection1 = sibs::BootstrapConnection::create(sibs::Ipv4("127.0.0.1", PORT)).get(); + std::unique_ptr<sibs::BootstrapConnection> connection1 = sibs::BootstrapConnection::connect(sibs::Ipv4("127.0.0.1", PORT)).get(); bool gotData1 = false; bool gotAsdf1 = false; connection1->listen(key, [&gotData1, &gotAsdf1](const sibs::DirectConnectionPeer *peer, const void *data, const sibs::usize size) @@ -37,7 +37,7 @@ int main() return true; }); - std::unique_ptr<sibs::BootstrapConnection> connection2 = sibs::BootstrapConnection::create(sibs::Ipv4("127.0.0.1", PORT)).get(); + std::unique_ptr<sibs::BootstrapConnection> connection2 = sibs::BootstrapConnection::connect(sibs::Ipv4("127.0.0.1", PORT)).get(); bool gotData2 = false; bool gotAsdf2 = false; connection2->listen(key, [&gotData2, &gotAsdf2](const sibs::DirectConnectionPeer *peer, const void *data, const sibs::usize size) |