Submit data to the testbed logger service. More...
Typedefs | |
typedef void(* | GNUNET_TESTBED_LOGGER_FlushCompletion) (void *cls, size_t size) |
Functions of this type are called to notify a successful transmission of the message to the logger service. More... | |
Functions | |
struct GNUNET_TESTBED_LOGGER_Handle * | GNUNET_TESTBED_LOGGER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Connect to the testbed logger service. More... | |
void | GNUNET_TESTBED_LOGGER_disconnect (struct GNUNET_TESTBED_LOGGER_Handle *h) |
Disconnect from the logger service. More... | |
void | GNUNET_TESTBED_LOGGER_write (struct GNUNET_TESTBED_LOGGER_Handle *h, const void *data, size_t size) |
Send data to be logged to the logger service. More... | |
void | GNUNET_TESTBED_LOGGER_flush (struct GNUNET_TESTBED_LOGGER_Handle *h, GNUNET_TESTBED_LOGGER_FlushCompletion cb, void *cb_cls) |
Flush the buffered data to the logger service. More... | |
void | GNUNET_TESTBED_LOGGER_flush_cancel (struct GNUNET_TESTBED_LOGGER_Handle *h) |
Cancel notification upon flush. More... | |
Submit data to the testbed logger service.
typedef void(* GNUNET_TESTBED_LOGGER_FlushCompletion) (void *cls, size_t size) |
Functions of this type are called to notify a successful transmission of the message to the logger service.
cls | the closure given to GNUNET_TESTBED_LOGGER_send() |
size | the amount of data sent |
Definition at line 82 of file gnunet_testbed_logger_service.h.
struct GNUNET_TESTBED_LOGGER_Handle* GNUNET_TESTBED_LOGGER_connect | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg | ) |
Connect to the testbed logger service.
cfg | configuration to use |
Definition at line 223 of file testbed_logger_api.c.
References cfg, GNUNET_CLIENT_connect(), GNUNET_free, GNUNET_new, h, GNUNET_ARM_Handle::mq, and mq_error_handler().
void GNUNET_TESTBED_LOGGER_disconnect | ( | struct GNUNET_TESTBED_LOGGER_Handle * | h | ) |
Disconnect from the logger service.
Also cancels any pending send handles.
h | the logger handle |
h | the logger handle |
Definition at line 248 of file testbed_logger_api.c.
References GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_MQ_destroy(), GNUNET_SCHEDULER_cancel(), h, LOG, and GNUNET_ARM_Handle::mq.
void GNUNET_TESTBED_LOGGER_write | ( | struct GNUNET_TESTBED_LOGGER_Handle * | h, |
const void * | data, | ||
size_t | size | ||
) |
Send data to be logged to the logger service.
The data will be buffered and will be sent upon an explicit call to GNUNET_TESTBED_LOGGER_flush() or upon exceeding a threshold size.
h | the logger handle |
data | the data to send; |
size | how many bytes of data to send |
Definition at line 278 of file testbed_logger_api.c.
References BUFFER_SIZE, data, dispatch_buffer(), GNUNET_memcpy, GNUNET_MIN, h, GNUNET_ARM_Handle::mq, and size.
Referenced by handle_p2p_estimate().
void GNUNET_TESTBED_LOGGER_flush | ( | struct GNUNET_TESTBED_LOGGER_Handle * | h, |
GNUNET_TESTBED_LOGGER_FlushCompletion | cb, | ||
void * | cb_cls | ||
) |
Flush the buffered data to the logger service.
h | the logger handle |
cb | the callback to call after the data is flushed |
cb_cls | the closure for cb |
Definition at line 301 of file testbed_logger_api.c.
References GNUNET_TESTBED_LOGGER_Handle::cb, GNUNET_TESTBED_LOGGER_Handle::cb_cls, dispatch_buffer(), GNUNET_assert, h, GNUNET_ARM_Handle::mq, and trigger_flush_notification().
Referenced by shutdown_task().
void GNUNET_TESTBED_LOGGER_flush_cancel | ( | struct GNUNET_TESTBED_LOGGER_Handle * | h | ) |
Cancel notification upon flush.
Should only be used when the flush completion callback given to GNUNET_TESTBED_LOGGER_flush() is not already called.
h | the logger handle |
Definition at line 326 of file testbed_logger_api.c.
References GNUNET_SCHEDULER_cancel(), and h.