package zmq

  1. Overview
  2. Docs
OCaml bindings for ZeroMQ 4.x

Install

Dune Dependency

Authors

Maintainers

Sources

zmq-5.1.3.tbz
sha256=24b32de3829a103e548f37e00f7e03fca72a00e1b67d6ee6d3d75fbae31b8806
sha512=7b4c1e7bce06d7f340603c7d56ffc1714c5a0601040d72bbe5591e3ae5cf24e7835b5da7bd525c19632db45059544ddcdeecd507298e993b7b761a764c1d8ff7

doc/zmq/Zmq/Monitor/index.html

Module Zmq.MonitorSource

Sourcetype t
Sourcetype address = string
Sourcetype error_no = int
Sourcetype error_text = string
Sourcetype event =
  1. | Connected of address * Unix.file_descr
  2. | Connect_delayed of address
  3. | Connect_retried of address * int
  4. | Listening of address * Unix.file_descr
  5. | Bind_failed of address * error_no * error_text
  6. | Accepted of address * Unix.file_descr
  7. | Accept_failed of address * error_no * error_text
  8. | Closed of address * Unix.file_descr
  9. | Close_failed of address * error_no * error_text
  10. | Disconnected of address * Unix.file_descr
  11. | Monitor_stopped of address
  12. | Handshake_failed_no_detail of address
  13. | Handshake_succeeded of address
  14. | Handshake_failed_protocol of address * int
  15. | Handshake_failed_auth of address * int
Sourceval create : 'a Socket.t -> t
Sourceval connect : Context.t -> t -> [> `Monitor ] Socket.t
Sourceval recv : ?block:bool -> [> `Monitor ] Socket.t -> event

Receive an event from the monitor socket. block indicates if the call should be blocking or non-blocking. Default true

Sourceval string_of_event : event -> string
Sourceval mk_string_of_event : unit -> event -> string

Create a memorizing function for converting an event to a string. As its it not possible to reliably retrieve the peer address of a closed socket dues to a race condition, this function pairs connects and disconnects and returns the matching connect peer address to disconnects.

Note that it is not possible to retrieve the peer address of connect events is the peer has disconnected before string_of_event is called

OCaml

Innovation. Community. Security.