Commit 76f572dc authored by Joseph Noir's avatar Joseph Noir

Fix spawn client function to create newbs

parent 043d5280
...@@ -680,13 +680,13 @@ spawn_newb(actor_system& sys, F fun, transport_policy_ptr transport, ...@@ -680,13 +680,13 @@ spawn_newb(actor_system& sys, F fun, transport_policy_ptr transport,
/// Spawn a new "newb" broker client to connect to `host`:`port`. /// Spawn a new "newb" broker client to connect to `host`:`port`.
template <class Protocol, spawn_options Os = no_spawn_options, class F, class... Ts> template <class Protocol, spawn_options Os = no_spawn_options, class F, class... Ts>
typename infer_handle_from_fun<F>::type expected<typename infer_handle_from_fun<F>::type>
spawn_client(actor_system& sys, F fun, transport_policy_ptr transport, spawn_client(actor_system& sys, F fun, transport_policy_ptr transport,
std::string host, uint16_t port, Ts&&... xs) { std::string host, uint16_t port, Ts&&... xs) {
expected<native_socket> esock = transport->connect(host, port); expected<native_socket> esock = transport->connect(host, port);
if (!esock) if (!esock)
return std::move(esock.error()); return std::move(esock.error());
return spawn_newb<Protocol>(sys, fun, std::move(transport), return spawn_newb<Protocol>(sys, fun, std::move(transport), *esock,
std::forward<Ts>(xs)...); std::forward<Ts>(xs)...);
} }
......
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