Commit b09795be authored by Dominik Charousset's avatar Dominik Charousset

Merge pull request #400 from sjappig/develop

Add reuse_addr argument in publish_local_groups
parents d56f226b 6b88a9d7
...@@ -30,7 +30,8 @@ namespace io { ...@@ -30,7 +30,8 @@ namespace io {
/// chooses a random high-level port. /// chooses a random high-level port.
/// @throws bind_failure /// @throws bind_failure
/// @throws network_error /// @throws network_error
uint16_t publish_local_groups(uint16_t port, const char* addr = nullptr); uint16_t publish_local_groups(uint16_t port, const char* addr = nullptr,
bool reuse_addr = false);
} // namespace io } // namespace io
} // namespace caf } // namespace caf
......
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
namespace caf { namespace caf {
namespace io { namespace io {
uint16_t publish_local_groups(uint16_t port, const char* addr) { uint16_t publish_local_groups(uint16_t port, const char* addr,
bool reuse_addr) {
auto group_nameserver = []() -> behavior { auto group_nameserver = []() -> behavior {
return { return {
[](get_atom, const std::string& name) { [](get_atom, const std::string& name) {
...@@ -37,7 +38,7 @@ uint16_t publish_local_groups(uint16_t port, const char* addr) { ...@@ -37,7 +38,7 @@ uint16_t publish_local_groups(uint16_t port, const char* addr) {
auto gn = spawn<hidden>(group_nameserver); auto gn = spawn<hidden>(group_nameserver);
uint16_t result; uint16_t result;
try { try {
result = publish(gn, port, addr); result = publish(gn, port, addr, reuse_addr);
} }
catch (std::exception&) { catch (std::exception&) {
anon_send_exit(gn, exit_reason::user_shutdown); anon_send_exit(gn, exit_reason::user_shutdown);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment