aboutsummaryrefslogtreecommitdiff
path: root/src/util/client.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-06-19 18:50:00 +0000
committerChristian Grothoff <christian@grothoff.org>2016-06-19 18:50:00 +0000
commit2042d867f71e3cb1d7ade6b3d474ce0c1f5f87bd (patch)
tree58be8b2e7321a91015df8ab3281a9f89a26cec1f /src/util/client.c
parentd8d3021ad9af2abe551fd6cd0fe2529a99d3683c (diff)
downloadgnunet-2042d867f71e3cb1d7ade6b3d474ce0c1f5f87bd.tar.gz
gnunet-2042d867f71e3cb1d7ade6b3d474ce0c1f5f87bd.zip
redefine GNUNET_MQ_queue_for_connection_client to capture client handle
Diffstat (limited to 'src/util/client.c')
-rw-r--r--src/util/client.c30
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 */
416struct GNUNET_MQ_Handle *
417GNUNET_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