Commit ce73a971 authored by Matthieu Dorier's avatar Matthieu Dorier

using margo_is_listening to check if wrapped margo instance is a server

parent 883c0226
......@@ -189,12 +189,30 @@ public:
&engine::on_finalize_cb, static_cast<void*>(this));
}
/**
* @brief Builds an engine around an existing margo instance.
*
* @param mid Margo instance.
* @param mode THALLIUM_SERVER_MODE or THALLIUM_CLIENT_MODE.
*/
[[deprecated]]
engine(margo_instance_id mid, int mode) {
m_mid = mid;
m_is_server = (mode == THALLIUM_SERVER_MODE);
m_owns_mid = false;
}
/**
* @brief Builds an engine around an existing margo instance.
*
* @param mid Margo instance.
*/
engine(margo_instance_id mid) {
m_mid = mid;
m_owns_mid = false;
m_is_server = margo_is_listening(mid);
}
/**
* @brief Copy-constructor is deleted.
*/
......
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