7.8

top ← prev up next →

ZeroMQ

Jay McCarthy <jay@racket-lang.org>

This package provides a binding for the ZeroMQ library.

This documentation does not describe meaning of API calls; it only describes their Racket calling conventions. For details on API semantics, refer to the documentation at the ZeroMQ site.

zmq_msg_init_data is not supported, because Racket pointers may be moved by the garbage collector before the ZeroMQ library is done with them.

Determines if x is a pointer to a ZeroMQ context.

Determines if x is a pointer to a ZeroMQ socket.

A contract for the symbols ' ( PAIR PUB SUB REQ REP DEALER ROUTER XREQ XREP PULL PUSH XPUB XSUB STREAM )

A contract for the symbols ' ( AFFINITY IDENTITY 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_RID GSSAPI_SERVER GSSAPI_PRINCIPAL GSSAPI_SERVICE_PRINCIPAL GSSAPI_PLAINTEXT HANDSHAKE_IVL SOCKS_PROXY XPUB_NODROP BLOCKY 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 )

A contract for any symbol in ' ( DONTWAIT NOBLOCK SNDMORE ) or any list of those symbols.

A contract for any symbol in ' ( POLLIN POLLOUT POLLERR ) or any list of those symbols.

An FFI binding for zmq_version

Determines if x is a ZeroMQ message.

malloc A ctype for ZeroMQ messages, suitable for using with

Determines if x is a ZeroMQ poll item.

procedure (make-poll-item socket fd events revents) → poll-item? socket : socket? fd : exact-nonnegative-integer? events : poll-status? revents : poll-status?

poll! Constructs a poll item for using with

Extracts the revents field from a poll item structure.

An FFI binding for zmq_init

An FFI binding for zmq_term

procedure ( call-with-context procedure [ #:io-threads io-threads ] ) → void procedure : ( procedure-arity-includes/c 1 ) io-threads : exact-nonnegative-integer? = 1

context call-with-context context-close! Using theprocedure,creates a context and passes it to a procedure with one argument. On return, it closes the context using

An FFI binding for zmq_msg_init

An FFI binding for zmq_msg_init_size

An FFI binding for zmq_msg_close

An FFI binding for zmq_msg_data

An FFI binding for zmq_msg_size

Creates a sized byte string from a message’s data.

free Returns a _msg ctype with no data. The _msg must be manually deallocated using

free Returns a _msg ctype whose msg-data is set to given the byte string. The _msg must be manually deallocated using

free Returns a _msg ctype whose size is set the given non-negative integer. The _msg must be manually deallocated using

An FFI binding for zmq_msg_copy

An FFI binding for zmq_msg_move

An FFI binding for zmq_socket

An FFI binding for zmq_close

procedure ( call-with-socket context socket-type procedure ) → void context : context? socket-type : socket-type? procedure : ( procedure-arity-includes/c 1 )

socket call-with-socket socket-type? socket-close! Using theprocedure,creates a socket of a validusing a previously created context. It passes the socket to a procedure with one argument. On return, it closes the socket using

Extracts the given option’s value from the socket, similar to zmq_getsockopt

Sets the given option’s value from the socket, similar to zmq_setsockopt

An FFI binding for zmq_bind

An FFI binding for zmq_connect

An FFI binding for zmq_msg_send

socket-send-msg! Sends a byte string on a socket usingand a temporary message.

procedure (socket-recv-msg! msg socket flags) → void msg : msg? socket : socket? flags : send/recv-flags?

An FFI binding for zmq_msg_recv

socket-recv-msg! Receives a byte string on a socket usingand a temporary message.

An FFI binding for zmq_poll

An FFI binding for zmq_proxy . Given two sockets and an optional capture socket, set up a proxy between the frontend socket and the backend socket.