diff options
Diffstat (limited to 'src/util/client.c')
-rw-r--r-- | src/util/client.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/util/client.c b/src/util/client.c index d00e8bbd0..e30ce6589 100644 --- a/src/util/client.c +++ b/src/util/client.c | |||
@@ -404,6 +404,36 @@ do_connect (const char *service_name, | |||
404 | 404 | ||
405 | 405 | ||
406 | /** | 406 | /** |
407 | * Create a message queue to connect to a GNUnet service. | ||
408 | * If handlers are specfied, receive messages from the connection. | ||
409 | * | ||
410 | * @param connection the client connection | ||
411 | * @param handlers handlers for receiving messages, can be NULL | ||
412 | * @param error_handler error handler | ||
413 | * @param error_handler_cls closure for the @a error_handler | ||
414 | * @return the message queue, NULL on error | ||
415 | */ | ||
416 | struct GNUNET_MQ_Handle * | ||
417 | GNUNET_CLIENT_connecT (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
418 | const char *service_name, | ||
419 | const struct GNUNET_MQ_MessageHandler *handlers, | ||
420 | GNUNET_MQ_ErrorHandler error_handler, | ||
421 | void *error_handler_cls) | ||
422 | { | ||
423 | struct GNUNET_CLIENT_Connection *c; | ||
424 | |||
425 | c = GNUNET_CLIENT_connect (service_name, | ||
426 | cfg); | ||
427 | if (NULL == c) | ||
428 | return NULL; | ||
429 | return GNUNET_MQ_queue_for_connection_client (c, | ||
430 | handlers, | ||
431 | error_handler, | ||
432 | error_handler_cls); | ||
433 | } | ||
434 | |||
435 | |||
436 | /** | ||
407 | * Get a connection with a service. | 437 | * Get a connection with a service. |
408 | * | 438 | * |
409 | * @param service_name name of the service | 439 | * @param service_name name of the service |