diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-09-27 23:12:21 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-09-27 23:12:21 +0200 |
commit | c8ed84e481b4abfb7d4ed844a4d74b979917c466 (patch) | |
tree | b37f1dfbfb279b78a4346ec22bc298bb500e8fb4 /src/include/gnunet_client_lib.h | |
parent | eadf4b7379049d32d7cfc5cffd4c88613f8a2a93 (diff) | |
download | gnunet-c8ed84e481b4abfb7d4ed844a4d74b979917c466.tar.gz gnunet-c8ed84e481b4abfb7d4ed844a4d74b979917c466.zip |
implementing GNUNET_CLIENT_test() to check for service operating
Diffstat (limited to 'src/include/gnunet_client_lib.h')
-rw-r--r-- | src/include/gnunet_client_lib.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h index 8e4984124..9fc52724c 100644 --- a/src/include/gnunet_client_lib.h +++ b/src/include/gnunet_client_lib.h | |||
@@ -47,6 +47,23 @@ extern "C" | |||
47 | 47 | ||
48 | 48 | ||
49 | /** | 49 | /** |
50 | * Test if the port or UNIXPATH of the given @a service_name | ||
51 | * is in use and thus (most likely) the respective service is up. | ||
52 | * | ||
53 | * @param cfg our configuration | ||
54 | * @param service_name name of the service to connect to | ||
55 | * @return #GNUNET_YES if the service is (likely) up (or running remotely), | ||
56 | * #GNUNET_NO if the service is (definitively) down, | ||
57 | * #GNUNET_SYSERR if the configuration does not give us | ||
58 | * the necessary information about the service, or if | ||
59 | * we could not check (i.e. socket() failed) | ||
60 | */ | ||
61 | int | ||
62 | GNUNET_CLIENT_test (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
63 | const char *service_name); | ||
64 | |||
65 | |||
66 | /** | ||
50 | * Create a message queue to connect to a GNUnet service. | 67 | * Create a message queue to connect to a GNUnet service. |
51 | * If handlers are specfied, receive messages from the connection. | 68 | * If handlers are specfied, receive messages from the connection. |
52 | * | 69 | * |
@@ -57,11 +74,11 @@ extern "C" | |||
57 | * @return the message queue, NULL on error | 74 | * @return the message queue, NULL on error |
58 | */ | 75 | */ |
59 | struct GNUNET_MQ_Handle * | 76 | struct GNUNET_MQ_Handle * |
60 | GNUNET_CLIENT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, | 77 | GNUNET_CLIENT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, |
61 | const char *service_name, | 78 | const char *service_name, |
62 | const struct GNUNET_MQ_MessageHandler *handlers, | 79 | const struct GNUNET_MQ_MessageHandler *handlers, |
63 | GNUNET_MQ_ErrorHandler error_handler, | 80 | GNUNET_MQ_ErrorHandler error_handler, |
64 | void *error_handler_cls); | 81 | void *error_handler_cls); |
65 | 82 | ||
66 | 83 | ||
67 | #if 0 /* keep Emacsens' auto-indent happy */ | 84 | #if 0 /* keep Emacsens' auto-indent happy */ |