$darkmode
Elektra 0.11.0
|
I/O Adapter for D-Bus. More...
#include <kdbassert.h>
#include <kdbhelper.h>
#include <kdbio/adapters/zeromq.h>
#include <kdblogger.h>
#include <stdlib.h>
#include <string.h>
Functions | |
ElektraIoAdapterZeroMqHandle * | elektraIoAdapterZeroMqAttach (void *socket, ElektraIoInterface *ioBinding, ElektraIoAdapterZeroMqCallbackType type, ElektraIoAdapterZeroMqCallback callback, void *context) |
Attach to ZeroMq socket. More... | |
void | elektraIoAdapterZeroMqSetContext (ElektraIoAdapterZeroMqHandle *handle, void *context) |
Set the callback context for a ZeroMq adapter handle. More... | |
int | elektraIoAdapterZeroMqDetach (ElektraIoAdapterZeroMqHandle *handle) |
Remove ZeroMq socket from I/O binding. More... | |
I/O Adapter for D-Bus.
ElektraIoAdapterZeroMqHandle* elektraIoAdapterZeroMqAttach | ( | void * | socket, |
ElektraIoInterface * | ioBinding, | ||
ElektraIoAdapterZeroMqCallbackType | type, | ||
ElektraIoAdapterZeroMqCallback | callback, | ||
void * | context | ||
) |
Attach to ZeroMq socket.
The callback is called whenever socket is readable or writable (depending on type) and data can be processed. The callback should not do blocking calls (e.g. use ZMQ_DONTWAIT for zmq_*recv()). Since ZeroMq guarantees that multipart messages arrive at once, data will be available. New adapter instances are enabled.
socket | ZeroMq socket |
ioBinding | I/O binding |
type | callback type ( |
callback | callback |
context | callback context (gets passed to callback) |
int elektraIoAdapterZeroMqDetach | ( | ElektraIoAdapterZeroMqHandle * | handle | ) |
Remove ZeroMq socket from I/O binding.
This function frees the passed handle.
handle | adapter handle |
1 | on success |
0 | on error |
void elektraIoAdapterZeroMqSetContext | ( | ElektraIoAdapterZeroMqHandle * | handle, |
void * | context | ||
) |
Set the callback context for a ZeroMq adapter handle.
The previous context is replaced and not freed.
handle | adapter handle |
context | new callback context |