I/O Adapter for D-Bus.
More...
#include <stdlib.h>
#include <string.h>
#include <zmq.h>
#include <kdbio.h>
I/O Adapter for D-Bus.
- Copyright
- BSD License (see LICENSE.md or https://www.libelektra.org)
◆ ElektraIoAdapterZeroMqCallback
typedef void(* ElektraIoAdapterZeroMqCallback) (void *socket, void *context) |
Callback for ZeroMq adapter callbacks.
- Parameters
-
socket | zeromq socket |
context | callback context supplied to elektraIoZeroMqAdapterAttach() |
◆ ElektraIoAdapterZeroMqHandle
◆ ElektraIoAdapterZeroMqCallbackType
callback types
Enumerator |
---|
ELEKTRA_IO_ADAPTER_ZEROMQCB_READ | callback is called when socket is readable
|
ELEKTRA_IO_ADAPTER_ZEROMQCB_WRITE | callback is called when socket is writable
|
◆ elektraIoAdapterZeroMqAttach()
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.
- Parameters
-
socket | ZeroMq socket |
ioBinding | I/O binding |
type | callback type ( |
- See also
- ElektraIoAdapterZeroMqCallbackType)
- Parameters
-
callback | callback |
context | callback context (gets passed to callback) |
- Returns
- handle to use with elektraIoZeroMqAdapterDetach() or NULL on error
◆ elektraIoAdapterZeroMqDetach()
Remove ZeroMq socket from I/O binding.
This function frees the passed handle.
- Parameters
-
- Return values
-
◆ elektraIoAdapterZeroMqSetContext()
Set the callback context for a ZeroMq adapter handle.
The previous context is replaced and not freed.
- Parameters
-
handle | adapter handle |
context | new callback context |