Module erlzmq

NIF based Erlang bindings for the ZeroMQ messaging library.

Description

NIF based Erlang bindings for the ZeroMQ messaging library.

Data Types

erlzmq_capability()

erlzmq_capability() = ipc | pgm | tipc | norm | curve | gssapi | draft

erlzmq_context()

abstract datatype: erlzmq_context()

erlzmq_ctxopt()

erlzmq_ctxopt() = blocky | io_threads | thread_sched_policy | thread_priority | thread_affinity_cpu_add | thread_affinity_cpu_remove | thread_name_prefix | max_msgsz | msg_t_size | socket_limit | max_sockets | ipv6

erlzmq_data()

erlzmq_data() = iolist()

erlzmq_endpoint()

erlzmq_endpoint() = string() | binary()

erlzmq_error()

erlzmq_error() = {error, erlzmq_error_type()}

erlzmq_error_type()

erlzmq_error_type() = efsm | enocompatproto | eterm | emthread | errno() | unknown

erlzmq_poll_event()

erlzmq_poll_event() = pollin | pollout | pollerr | pollpri

erlzmq_send_recv_flag()

erlzmq_send_recv_flag() = dontwait | sndmore | recvmore

erlzmq_send_recv_flags()

erlzmq_send_recv_flags() = [erlzmq_send_recv_flag()]

erlzmq_socket()

abstract datatype: erlzmq_socket()

erlzmq_socket_type()

erlzmq_socket_type() = pair | pub | sub | req | rep | dealer | router | xreq | xrep | pull | push | xpub | xsub | stream

erlzmq_sockopt()

erlzmq_sockopt() = affinity | routing_id | subscribe | unsubscribe | rate | recovery_ivl | sndbuf | rcvbuf | rcvmore | fd | events | type | linger | reconnect_ivl | backlog | reconnect_ivl_max | maxmsgsize | sndhwm | rcvhwm | multicast_hops | rcvtimeo | sndtimeo | last_endpoint | router_mandatory | tcp_keepalive | tcp_keepalive_cnt | tcp_keepalive_idle | tcp_keepalive_intvl | immediate | xpub_verbose | router_raw | ipv6 | mechanism | plain_server | plain_username | plain_password | curve_server | curve_publickey | curve_secretkey | curve_serverkey | probe_router | req_correlate | req_relaxed | conflate | zap_domain | router_handover | tos | connect_routing_id | gssapi_server | gssapi_principal | gssapi_service_principal | gssapi_plaintext | handshake_ivl | socks_proxy | xpub_nodrop | xpub_manual | xpub_welcome_msg | stream_notify | invert_matching | heartbeat_ivl | heartbeat_ttl | heartbeat_timeout | xpub_verboser | connect_timeout | tcp_maxrt | thread_safe | multicast_maxtpdu | vmci_buffer_size | vmci_buffer_min_size | vmci_buffer_max_size | vmci_connect_timeout | use_fd | gssapi_principal_nametype | gssapi_service_principal_nametype | bindtodevice | ipv4only | tcp_accept_filter | connect_rid | delay_attach_on_connect | noblock | fail_unroutable | router_behavior | identity

erlzmq_sockopt_value()

erlzmq_sockopt_value() = integer() | iolist()

errno()

errno() = eperm | enoent | srch | eintr | eio | enxio | ebad | echild | edeadlk | enomem | eacces | efault | enotblk | ebusy | eexist | exdev | enodev | enotdir | eisdir | einval | enfile | emfile | enotty | etxtbsy | efbig | enospc | espipe | erofs | emlink | epipe | eagain | einprogress | ealready | enotsock | edestaddrreq | emsgsize | eprototype | enoprotoopt | eprotonosupport | esocktnosupport | enotsup | epfnosupport | eafnosupport | eaddrinuse | eaddrnotavail | enetdown | enetunreach | enetreset | econnaborted | econnreset | enobufs | eisconn | enotconn | eshutdown | etoomanyrefs | ehostunreach | etimedout | econnrefused | eloop | enametoolong | eaddnotavail

Function Index

bind/2Accept connections on a socket.
close/1Close the given socket.
connect/2Connect a socket.
context/0Equivalent to context(1).
context/1Create a new erlzmq context with the specified number of io threads.
ctx_get/2Get an option associated with a context.
ctx_set/3Set an option associated with an option.
curve_keypair/0Generate a Curve keypair.
disconnect/2Disonnect a socket.
getsockopt/2Get an option associated with a socket.
has/1Checks if 0MQ library has given capability.
poll/3Allows multiplexing input output over 1 socket.
recv/1Equivalent to recv(Socket, 0).
recv/2Receive a message from a socket.
recvmsg/1This function exists for zeromq api compatibility and doesn't actually provide any different functionality then what you get with the erlzmq:recv/3 function.
recvmsg/2This function exists for zeromq api compatibility and doesn't actually provide any different functionality then what you get with the erlzmq:recv/3 function.
send/2Equivalent to send(Socket, Msg, []).
send/3Send a message on a socket.
sendmsg/2This function exists for zeromq api compatibility and doesn't actually provide any different functionality then what you get with the erlzmq:send/2 function.
sendmsg/3This function exists for zeromq api compatibility and doesn't actually provide any different functionality then what you get with the erlzmq:send/3 function.
setsockopt/3Set an option associated with a socket.
socket/2Create a socket.
term/1Terminate the given context.
unbind/2Stop accept connections on a socket.
version/0Returns the 0MQ library version.
z85_decode/1Decode a Z85-encode binary.
z85_encode/1Encode a binary into Z85.

Function Details

bind/2

bind(Socket::erlzmq_socket(), Endpoint::erlzmq_endpoint()) -> ok | erlzmq_error()

Accept connections on a socket.
For more information see zmq_bind.

close/1

close(Socket::erlzmq_socket()) -> ok | erlzmq_error()

Close the given socket.
For more information see zmq_close.

connect/2

connect(Socket::erlzmq_socket(), Endpoint::erlzmq_endpoint()) -> ok | erlzmq_error()

Connect a socket.
For more information see zmq_connect.

context/0

context() -> {ok, erlzmq_context()} | erlzmq_error()

Equivalent to context(1).

context/1

context(Threads::pos_integer()) -> {ok, erlzmq_context()} | erlzmq_error()

Create a new erlzmq context with the specified number of io threads.
If the context can be created an 'ok' tuple containing an erlzmq_context() handle to the created context is returned; if not, it returns an 'error' tuple with an erlzmq_type_error() describing the error.
The context must be later cleaned up calling term/1
For more information see zmq_init

ctx_get/2

ctx_get(Context::erlzmq_context(), Name::erlzmq_ctxopt()) -> {ok, integer()} | erlzmq_error()

Get an option associated with a context.
For more information see zmq_ctx_get.

ctx_set/3

ctx_set(Context::erlzmq_context(), Name::erlzmq_ctxopt(), Value::integer()) -> ok | erlzmq_error()

Set an option associated with an option.
NOTE: Setting max_sockets will have no effect, due to the implementation of zeromq. Instead, set max_sockets when creating the context.
For more information see zmq_ctx_set.

curve_keypair/0

curve_keypair() -> {ok, binary(), binary()} | erlzmq_error()

Generate a Curve keypair.
This will return two 40-character binaries, each a Z85-encoded version of the 32-byte keys from curve.
For more information see zmq_curve_keypair.

disconnect/2

disconnect(Socket::erlzmq_socket(), Endpoint::erlzmq_endpoint()) -> ok | erlzmq_error()

Disonnect a socket.
For more information see zmq_disconnect.

getsockopt/2

getsockopt(Socket::erlzmq_socket(), Name::erlzmq_sockopt()) -> {ok, erlzmq_sockopt_value()} | erlzmq_error()

Get an option associated with a socket.
For more information see zmq_getsockopt.

has/1

has(Capability::erlzmq_capability()) -> boolean() | unknown | erlzmq_error()

Checks if 0MQ library has given capability.
For more information see zmq_has.

poll/3

poll(X1::erlzmq_socket(), Flags::[erlzmq_poll_event()], Timeout::integer()) -> {ok, [erlzmq_poll_event()]} | erlzmq_error()

Allows multiplexing input output over 1 socket. Unlike zmq version only 1 socket is supported
For more information see zmq_poll.

recv/1

recv(Socket::erlzmq_socket()) -> {ok, erlzmq_data()} | erlzmq_error()

Equivalent to recv(Socket, 0).

recv/2

recv(Socket::erlzmq_socket(), Flags::erlzmq_send_recv_flags()) -> {ok, erlzmq_data()} | erlzmq_error()

Receive a message from a socket.
For more information see zmq_recv.

recvmsg/1

recvmsg(Socket::erlzmq_socket()) -> {ok, erlzmq_data()} | erlzmq_error()

Equivalent to recv(Socket, 0).

This function exists for zeromq api compatibility and doesn't actually provide any different functionality then what you get with the erlzmq:recv/3 function. In fact this function just calls that function. So there is a slight bit of additional overhead as well.

recvmsg/2

recvmsg(Socket::erlzmq_socket(), Flags::erlzmq_send_recv_flags()) -> {ok, erlzmq_data()} | erlzmq_error()

Equivalent to recv(Socket, Flags).

This function exists for zeromq api compatibility and doesn't actually provide any different functionality then what you get with the erlzmq:recv/3 function. In fact this function just calls that function. So there is a slight bit of additional overhead as well.

send/2

send(Socket::erlzmq_socket(), Binary::binary()) -> ok | erlzmq_error()

Equivalent to send(Socket, Msg, []).

send/3

send(X1::erlzmq_socket(), Binary::binary(), Flags::erlzmq_send_recv_flags()) -> ok | erlzmq_error()

Send a message on a socket.
For more information see zmq_send.

sendmsg/2

sendmsg(Socket::erlzmq_socket(), Binary::binary()) -> ok | erlzmq_error()

Equivalent to send(Socket, Msg, []).

This function exists for zeromq api compatibility and doesn't actually provide any different functionality then what you get with the erlzmq:send/2 function. In fact this function just calls that function. So there is a slight bit of additional overhead as well.

sendmsg/3

sendmsg(Socket::erlzmq_socket(), Binary::binary(), Flags::erlzmq_send_recv_flags()) -> ok | erlzmq_error()

Equivalent to send(Socket, Msg, Flags).

This function exists for zeromq api compatibility and doesn't actually provide any different functionality then what you get with the erlzmq:send/3 function. In fact this function just calls that function. So there is a slight bit of additional overhead as well.

setsockopt/3

setsockopt(Socket::erlzmq_socket(), Name::erlzmq_sockopt(), Value::erlzmq_sockopt_value() | binary()) -> ok | erlzmq_error()

Set an option associated with a socket.
For more information see zmq_setsockopt.

socket/2

socket(Context::erlzmq_context(), Type::erlzmq_socket_type()) -> {ok, erlzmq_socket()} | erlzmq_error()

Create a socket.
This functions creates a socket of the given type and associates it with the given context.
If the socket can be created an 'ok' tuple containing a erlzmq_socket() handle to the created socket is returned; if not, it returns an erlzmq_error() describing the error.
For more information see zmq_socket.

term/1

term(Context::erlzmq_context()) -> ok | erlzmq_error()

Terminate the given context.
For more information see zmq_term.

unbind/2

unbind(Socket::erlzmq_socket(), Endpoint::erlzmq_endpoint()) -> ok | erlzmq_error()

Stop accept connections on a socket.
For more information see zmq_unbind.

version/0

version() -> {integer(), integer(), integer()}

Returns the 0MQ library version.

z85_decode/1

z85_decode(Z85::binary()) -> {ok, binary()} | erlzmq_error()

Decode a Z85-encode binary
This will take a binary of size 5*n, and return a binary of size 4*n.
For more information see zmq_z85_decode.

z85_encode/1

z85_encode(Binary::binary()) -> {ok, binary()} | erlzmq_error()

Encode a binary into Z85
This will take a binary of size 4*n, and return a binary of size 5*n.
For more information see zmq_z85_encode.


Generated by EDoc