Commit de0c81ce authored by Dominik Charousset's avatar Dominik Charousset

added overloads to publish() and remote_actor() to use user-defined input/output streams

parent 94a61572
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
#include "cppa/event_based_actor.hpp" #include "cppa/event_based_actor.hpp"
#include "cppa/util/rm_ref.hpp" #include "cppa/util/rm_ref.hpp"
#include "cppa/util/acceptor.hpp"
#include "cppa/detail/actor_count.hpp" #include "cppa/detail/actor_count.hpp"
#include "cppa/detail/get_behavior.hpp" #include "cppa/detail/get_behavior.hpp"
...@@ -745,6 +746,15 @@ inline void await_all_others_done() { ...@@ -745,6 +746,15 @@ inline void await_all_others_done() {
*/ */
void publish(actor_ptr whom, std::uint16_t port); void publish(actor_ptr whom, std::uint16_t port);
/**
* @brief Publishes @p whom using @p acceptor to handle incoming connections.
*
* The connection is automatically closed if the lifetime of @p whom ends.
* @param whom Actor that should be published at @p port.
* @param acceptor Network technology-specific acceptor implementation.
*/
void publish(actor_ptr whom, std::unique_ptr<util::acceptor> acceptor);
/** /**
* @brief Establish a new connection to the actor at @p host on given @p port. * @brief Establish a new connection to the actor at @p host on given @p port.
* @param host Valid hostname or IP address. * @param host Valid hostname or IP address.
...@@ -761,6 +771,15 @@ inline actor_ptr remote_actor(const std::string& host, std::uint16_t port) { ...@@ -761,6 +771,15 @@ inline actor_ptr remote_actor(const std::string& host, std::uint16_t port) {
return remote_actor(host.c_str(), port); return remote_actor(host.c_str(), port);
} }
/**
* @brief Establish a new connection to the actor via given @p connection.
* @param connection A connection to another libcppa process described by a pair
* of input and output stream.
* @returns An {@link actor_ptr} to the proxy instance
* representing a remote actor.
*/
actor_ptr remote_actor(util::io_stream_ptr_pair connection);
} // namespace cppa } // namespace cppa
namespace std { namespace std {
......
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