Type alias Event

Event: EventFor<"accept", EventAddress> | EventFor<"accept:error", EventAddress & EventError> | EventFor<"bind", EventAddress> | EventFor<"bind:error", EventAddress & EventError> | EventFor<"connect", EventAddress> | EventFor<"connect:delay", EventAddress> | EventFor<"connect:retry", EventAddress & EventInterval> | EventFor<"close", EventAddress> | EventFor<"close:error", EventAddress & EventError> | EventFor<"disconnect", EventAddress> | EventFor<"end"> | EventFor<"handshake", EventAddress> | EventFor<"handshake:error:protocol", EventAddress & EventError<ProtoError>> | EventFor<"handshake:error:auth", EventAddress & EventError<AuthError>> | EventFor<"handshake:error:other", EventAddress & EventError> | EventFor<"unknown">

A union type that represents all possible even types and the associated data. Events always have a type property with an EventType value.

The following socket events can be generated. This list may be different depending on the ZeroMQ version that is used.

Note that the error event is avoided by design, since this has a special behaviour in Node.js causing an exception to be thrown if it is unhandled.

Other error names are adjusted to be as close to possible as other networking related event names in Node.js and/or to the corresponding ZeroMQ.js method call. Events (including any errors) that correspond to a specific operation are namespaced with a colon :, e.g. bind:error or connect:retry.

  • accept - ZMQ_EVENT_ACCEPTED The socket has accepted a connection from a remote peer.

  • accept:error - ZMQ_EVENT_ACCEPT_FAILED The socket has rejected a connection from a remote peer.

    The following additional details will be included with this event:

    • error - An error object that describes the specific error that occurred.
  • bind - ZMQ_EVENT_LISTENING The socket was successfully bound to a network interface.

  • bind:error - ZMQ_EVENT_BIND_FAILED The socket could not bind to a given interface.

    The following additional details will be included with this event:

    • error - An error object that describes the specific error that occurred.
  • connect - ZMQ_EVENT_CONNECTED The socket has successfully connected to a remote peer.

  • connect:delay - ZMQ_EVENT_CONNECT_DELAYED A connect request on the socket is pending.

  • connect:retry - ZMQ_EVENT_CONNECT_RETRIED A connection attempt is being handled by reconnect timer. Note that the reconnect interval is recalculated at each retry.

    The following additional details will be included with this event:

    • interval - The current reconnect interval.
  • close - ZMQ_EVENT_CLOSED The socket was closed.

  • close:error - ZMQ_EVENT_CLOSE_FAILED The socket close failed. Note that this event occurs only on IPC transports..

    The following additional details will be included with this event:

    • error - An error object that describes the specific error that occurred.
  • disconnect - ZMQ_EVENT_DISCONNECTED The socket was disconnected unexpectedly.

  • handshake - ZMQ_EVENT_HANDSHAKE_SUCCEEDED The ZMTP security mechanism handshake succeeded. NOTE: This event may still be in DRAFT statea and not yet available in stable releases.

  • handshake:error:protocol - ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL The ZMTP security mechanism handshake failed due to some mechanism protocol error, either between the ZMTP mechanism peers, or between the mechanism server and the ZAP handler. This indicates a configuration or implementation error in either peer resp. the ZAP handler. NOTE: This event may still be in DRAFT state and not yet available in stable releases.

  • handshake:error:auth - ZMQ_EVENT_HANDSHAKE_FAILED_AUTH The ZMTP security mechanism handshake failed due to an authentication failure. NOTE: This event may still be in DRAFT state and not yet available in stable releases.

  • handshake:error:other - ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL Unspecified error during handshake. NOTE: This event may still be in DRAFT state and not yet available in stable releases.

  • end - ZMQ_EVENT_MONITOR_STOPPED Monitoring on this socket ended.

  • unknown An event was generated by ZeroMQ that the Node.js library could not interpret. Please submit a pull request for new event types if they are not yet included.

Generated using TypeDoc