ZeroMQ
On this page:
9.0
top
← prev up next →

ZeroMQπŸ”— i

Jay McCarthy <jay@racket-lang.org>

(require net/zmq ) package: zeromq

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.

procedure

( context? x)boolean?

x:any/c
Determines if x is a pointer to a ZeroMQ context.

procedure

( socket? x)boolean?

x:any/c
Determines if x is a pointer to a ZeroMQ socket.
A contract for the symbols '(PAIRPUBSUBREQREPDEALERROUTERXREQXREPPULLPUSHXPUBXSUBSTREAM)
A contract for the symbols '(AFFINITYIDENTITYSUBSCRIBEUNSUBSCRIBERATERECOVERY_IVLSNDBUFRCVBUFRCVMOREFDEVENTSTYPELINGERRECONNECT_IVLBACKLOGRECONNECT_IVL_MAXMAXMSGSIZESNDHWMRCVHWMMULTICAST_HOPSRCVTIMEOSNDTIMEOLAST_ENDPOINTROUTER_MANDATORYTCP_KEEPALIVETCP_KEEPALIVE_CNTTCP_KEEPALIVE_IDLETCP_KEEPALIVE_INTVLIMMEDIATEXPUB_VERBOSEROUTER_RAWIPV6MECHANISMPLAIN_SERVERPLAIN_USERNAMEPLAIN_PASSWORDCURVE_SERVERCURVE_PUBLICKEYCURVE_SECRETKEYCURVE_SERVERKEYPROBE_ROUTERREQ_CORRELATEREQ_RELAXEDCONFLATEZAP_DOMAINROUTER_HANDOVERTOSCONNECT_RIDGSSAPI_SERVERGSSAPI_PRINCIPALGSSAPI_SERVICE_PRINCIPALGSSAPI_PLAINTEXTHANDSHAKE_IVLSOCKS_PROXYXPUB_NODROPBLOCKYXPUB_MANUALXPUB_WELCOME_MSGSTREAM_NOTIFYINVERT_MATCHINGHEARTBEAT_IVLHEARTBEAT_TTLHEARTBEAT_TIMEOUTXPUB_VERBOSERCONNECT_TIMEOUTTCP_MAXRTTHREAD_SAFEMULTICAST_MAXTPDUVMCI_BUFFER_SIZEVMCI_BUFFER_MIN_SIZEVMCI_BUFFER_MAX_SIZEVMCI_CONNECT_TIMEOUTUSE_FD)
A contract for any symbol in '(DONTWAITNOBLOCKSNDMORE) or any list of those symbols.
A contract for any symbol in '(POLLINPOLLOUTPOLLERR) or any list of those symbols.
An FFI binding for zmq_version.

procedure

( msg? x)boolean?

x:any/c
Determines if x is a ZeroMQ message.

value

_msg :ctype?

A ctype for ZeroMQ messages, suitable for using with malloc .

procedure

( poll-item? x)boolean?

x:any/c
Determines if x is a ZeroMQ poll item.

procedure

( make-poll-item socketfdeventsrevents)poll-item?

socket:socket?
events:poll-status?
revents:poll-status?
Constructs a poll item for using with poll! .

procedure

( poll-item-revents pi)poll-status?

Extracts the revents field from a poll item structure.

procedure

( context io_threads)context?

An FFI binding for zmq_init.

procedure

( context-close! context)void

context:context?
An FFI binding for zmq_term.

procedure

( call-with-context procedure
[ #:io-threadsio-threads])void
Using the context procedure, call-with-context creates a context and passes it to a procedure with one argument. On return, it closes the context using context-close!

procedure

( msg-init! msg)void

msg:msg?
An FFI binding for zmq_msg_init.

procedure

( msg-init-size! msgsize)void

msg:msg?
An FFI binding for zmq_msg_init_size.

procedure

( msg-close! msg)void

msg:msg?
An FFI binding for zmq_msg_close.

procedure

( msg-data-pointer msg)cpointer?

msg:msg?
An FFI binding for zmq_msg_data.
msg:msg?
An FFI binding for zmq_msg_size.

procedure

( msg-data msg)bytes?

msg:msg?
Creates a sized byte string from a message’s data.

procedure

( make-empty-msg )msg?

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

procedure

( make-msg-with-data bytes)msg?

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

procedure

( make-msg-with-size exact-nonnegative-integer)msg?

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

procedure

( msg-copy! destsrc)void

dest:msg?
src:msg?
An FFI binding for zmq_msg_copy.

procedure

( msg-move! destsrc)void

dest:msg?
src:msg?
An FFI binding for zmq_msg_move.

procedure

( socket ctxttype)socket?

ctxt:context?
An FFI binding for zmq_socket.

procedure

( socket-close! socket)void

socket:socket?
An FFI binding for zmq_close.

procedure

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

procedure

( socket-option socketoption-name)

socket:socket?
option-name:option-name?
Extracts the given option’s value from the socket, similar to zmq_getsockopt.

procedure

option-name
option-value)void
socket:socket?
option-name:option-name?
Sets the given option’s value from the socket, similar to zmq_setsockopt.

procedure

( socket-bind! socketendpoint)void

socket:socket?
endpoint:string?
An FFI binding for zmq_bind.

procedure

( socket-connect! socketendpoint)void

socket:socket?
endpoint:string?
An FFI binding for zmq_connect.

procedure

( socket-send-msg! msgsocketflags)exact-integer?

msg:msg?
socket:socket?
An FFI binding for zmq_msg_send.

procedure

( socket-send! socketbytes)void

socket:socket?
bytes:bytes?
Sends a byte string on a socket using socket-send-msg! and a temporary message.

procedure

( socket-recv-msg! msgsocketflags)void

msg:msg?
socket:socket?
An FFI binding for zmq_msg_recv.

procedure

( socket-recv! socket)bytes?

socket:socket?
Receives a byte string on a socket using socket-recv-msg! and a temporary message.

procedure

( poll! itemstimeout)(or/c false? exact-positive-integer? )

timeout:exact-integer?
An FFI binding for zmq_poll.

procedure

( proxy! frontendbackend[capture])void

frontend:socket?
backend:socket?
capture:(or/c socket? false? )=#f
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.

top
← prev up next →

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /