diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-01-30 13:38:49 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-01-30 13:38:49 +0000 |
commit | f3b225f570302afef710c58e22b75efd81e71e56 (patch) | |
tree | 9fcfbca8decfa22a7ddf58ff928dd05fa55a0e7b /src/include/gnunet_core_service.h | |
parent | c58e7239c70925b7045d109fa1c7eaf8e2659604 (diff) | |
download | gnunet-f3b225f570302afef710c58e22b75efd81e71e56.tar.gz gnunet-f3b225f570302afef710c58e22b75efd81e71e56.zip |
function to synchronously check if a peer is connected at CORE level
Diffstat (limited to 'src/include/gnunet_core_service.h')
-rw-r--r-- | src/include/gnunet_core_service.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h index ca4048b52..4af8ef2cf 100644 --- a/src/include/gnunet_core_service.h +++ b/src/include/gnunet_core_service.h | |||
@@ -326,6 +326,26 @@ void | |||
326 | GNUNET_CORE_is_peer_connected_cancel (struct GNUNET_CORE_ConnectTestHandle *cth); | 326 | GNUNET_CORE_is_peer_connected_cancel (struct GNUNET_CORE_ConnectTestHandle *cth); |
327 | 327 | ||
328 | 328 | ||
329 | /** | ||
330 | * Check if the given peer is currently connected. This function is for special | ||
331 | * cirumstances (GNUNET_TESTBED uses it), normal users of the CORE API are | ||
332 | * expected to track which peers are connected based on the connect/disconnect | ||
333 | * callbacks from GNUNET_CORE_connect. This function is NOT part of the | ||
334 | * 'versioned', 'official' API. The difference between this function and the | ||
335 | * function GNUNET_CORE_is_peer_connected() is that this one returns | ||
336 | * synchronously after looking in the CORE API cache. The function | ||
337 | * GNUNET_CORE_is_peer_connected() sends a message to the CORE service and hence | ||
338 | * its response is given asynchronously. | ||
339 | * | ||
340 | * @param h the core handle | ||
341 | * @param pid the identity of the peer to check if it has been connected to us | ||
342 | * @return GNUNET_YES if the peer is connected to us; GNUNET_NO if not | ||
343 | */ | ||
344 | int | ||
345 | GNUNET_CORE_is_peer_connected_sync (const struct GNUNET_CORE_Handle *h, | ||
346 | const struct GNUNET_PeerIdentity *pid); | ||
347 | |||
348 | |||
329 | #if 0 /* keep Emacsens' auto-indent happy */ | 349 | #if 0 /* keep Emacsens' auto-indent happy */ |
330 | { | 350 | { |
331 | #endif | 351 | #endif |