Commit 2676c8cf authored by Matthieu Dorier's avatar Matthieu Dorier

added margo_registered_disabled_respone and margo_is_listening

parent 9393e587
......@@ -115,6 +115,16 @@ void margo_finalize(
void margo_wait_for_finalize(
margo_instance_id mid);
/**
* Checks whether a Margo instance we initialized as a server.
*
* @param [in] mid Margo instance
*
* @return HG_TRUE if listening or HG_FALSE if not, or not a valid margo instance.
*/
hg_bool_t margo_is_listening(
margo_instance_id mid);
/**
* Installs a callback to be called before the margo instance is finalize.
* Callbacks installed will be called in reverse ordered than they have been
......@@ -291,6 +301,20 @@ hg_return_t margo_registered_disable_response(
hg_id_t id,
int disable_flag);
/**
* Checks if response is disabled for a given RPC ID.
*
* @param [in] mid Margo instance
* @param [in] id registered function ID
* @param [ou] disabled_flag flag indicating whether response is disabled (1) or not (0)
*
* @return HG_SUCCESS or corresponding HG error code
*/
hg_return_t margo_registered_disabled_response(
margo_instance_id mid,
hg_id_t id,
int* disabled_flag);
/**
* Lookup an addr from a peer address/name.
* \param [in] name lookup name
......
......@@ -486,6 +486,13 @@ void margo_wait_for_finalize(margo_instance_id mid)
return;
}
hg_bool_t margo_is_listening(
margo_instance_id mid)
{
if(!mid) return HG_FALSE;
return HG_Class_is_listening(mid->hg_class);
}
void margo_push_finalize_callback(
margo_instance_id mid,
void(*cb)(void*),
......@@ -613,6 +620,18 @@ hg_return_t margo_registered_disable_response(
return(HG_Registered_disable_response(mid->hg_class, id, disable_flag));
}
hg_return_t margo_registered_disabled_response(
margo_instance_id mid,
hg_id_t id,
int* disabled_flag)
{
hg_bool_t b;
hg_return_t ret = HG_Registered_disabled_response(mid->hg_class, id, &b);
if(ret != HG_SUCCESS) return ret;
*disabled_flag = b;
return HG_SUCCESS;
}
struct lookup_cb_evt
{
hg_return_t hret;
......
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