aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_core_service.h
diff options
context:
space:
mode:
authorharsha <harsha@140774ce-b5e7-0310-ab8b-a85725594a96>2013-01-30 13:38:49 +0000
committerharsha <harsha@140774ce-b5e7-0310-ab8b-a85725594a96>2013-01-30 13:38:49 +0000
commitd728fd2656a634b269dab440147148f923315a32 (patch)
tree9fcfbca8decfa22a7ddf58ff928dd05fa55a0e7b /src/include/gnunet_core_service.h
parent7afd8f1e8f375105f4bf767882fffdb61c3ddf88 (diff)
function to synchronously check if a peer is connected at CORE level
git-svn-id: https://gnunet.org/svn/gnunet@25944 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/include/gnunet_core_service.h')
-rw-r--r--src/include/gnunet_core_service.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h
index ca4048b522..4af8ef2cf7 100644
--- a/src/include/gnunet_core_service.h
+++ b/src/include/gnunet_core_service.h
@@ -326,6 +326,26 @@ void
GNUNET_CORE_is_peer_connected_cancel (struct GNUNET_CORE_ConnectTestHandle *cth);
+/**
+ * Check if the given peer is currently connected. This function is for special
+ * cirumstances (GNUNET_TESTBED uses it), normal users of the CORE API are
+ * expected to track which peers are connected based on the connect/disconnect
+ * callbacks from GNUNET_CORE_connect. This function is NOT part of the
+ * 'versioned', 'official' API. The difference between this function and the
+ * function GNUNET_CORE_is_peer_connected() is that this one returns
+ * synchronously after looking in the CORE API cache. The function
+ * GNUNET_CORE_is_peer_connected() sends a message to the CORE service and hence
+ * its response is given asynchronously.
+ *
+ * @param h the core handle
+ * @param pid the identity of the peer to check if it has been connected to us
+ * @return GNUNET_YES if the peer is connected to us; GNUNET_NO if not
+ */
+int
+GNUNET_CORE_is_peer_connected_sync (const struct GNUNET_CORE_Handle *h,
+ const struct GNUNET_PeerIdentity *pid);
+
+
#if 0 /* keep Emacsens' auto-indent happy */
{
#endif