![]() |
![]()
| ![]() |
![]()
NAMEzmonitor - Class for socket event monitor SYNOPSIS// Create new zmonitor actor instance to monitor a zsock_t socket: // // zactor_t *monitor = zactor_new (zmonitor, mysocket); // // Destroy zmonitor instance. // // zactor_destroy (&monitor); // // Enable verbose logging of commands and activity. // // zstr_send (monitor, "VERBOSE"); // // Listen to monitor event type (zero or types, ending in NULL): // zstr_sendx (monitor, "LISTEN", type, ..., NULL); // // Events: // CONNECTED // CONNECT_DELAYED // CONNECT_RETRIED // LISTENING // BIND_FAILED // ACCEPTED // ACCEPT_FAILED // CLOSED // CLOSE_FAILED // DISCONNECTED // MONITOR_STOPPED // ALL // // Start monitor; after this, any further LISTEN commands are ignored. // // zstr_send (monitor, "START"); // zsock_wait (monitor); // // Receive next monitor event: // // zmsg_t *msg = zmsg_recv (monitor); // // This is the zmonitor constructor as a zactor_fn; the argument can be // a zactor_t, zsock_t, or libzmq void * socket: CZMQ_EXPORT void DESCRIPTIONThe zmonitor actor provides an API for obtaining socket events such as connected, listen, disconnected, etc. Socket events are only available for sockets connecting or bound to ipc:// and tcp:// endpoints. This class wraps the ZMQ socket monitor API, see zmq_socket_monitor for details. Works on all versions of libzmq from 3.2 onwards. This class replaces zproxy_v2, and is meant for applications that use the CZMQ v3 API (meaning, zsock). EXAMPLEFrom zmonitor_test method. zsock_t *client = zsock_new (ZMQ_DEALER); assert (client); zactor_t *clientmon = zactor_new (zmonitor, client); assert (clientmon); if (verbose) AUTHORSThe czmq manual was written by the authors in the AUTHORS file. RESOURCESMain web site: Report bugs to the email <zeromq-dev@lists.zeromq.org[1]> COPYRIGHTCopyright (c) the Contributors as noted in the AUTHORS file. This file is part of CZMQ, the high-level C binding for 0MQ: http://czmq.zeromq.org. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. LICENSE included with the czmq distribution. NOTES
mailto:zeromq-dev@lists.zeromq.org
|