reaper.hpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MPL-2.0 */
2 
3 #ifndef __ZMQ_REAPER_HPP_INCLUDED__
4 #define __ZMQ_REAPER_HPP_INCLUDED__
5 
6 #include "object.hpp"
7 #include "mailbox.hpp"
8 #include "poller.hpp"
9 #include "i_poll_events.hpp"
10 
11 namespace zmq
12 {
13 class ctx_t;
14 class socket_base_t;
15 
16 class reaper_t ZMQ_FINAL : public object_t, public i_poll_events
17 {
18  public:
19  reaper_t (zmq::ctx_t *ctx_, uint32_t tid_);
20  ~reaper_t ();
21 
22  mailbox_t *get_mailbox ();
23 
24  void start ();
25  void stop ();
26 
27  // i_poll_events implementation.
28  void in_event ();
29  void out_event ();
30  void timer_event (int id_);
31 
32  private:
33  // Command handlers.
34  void process_stop ();
35  void process_reap (zmq::socket_base_t *socket_);
36  void process_reaped ();
37 
38  // Reaper thread accesses incoming commands via this mailbox.
39  mailbox_t _mailbox;
40 
41  // Handle associated with mailbox' file descriptor.
42  poller_t::handle_t _mailbox_handle;
43 
44  // I/O multiplexing is performed using a poller object.
45  poller_t *_poller;
46 
47  // Number of sockets being reaped at the moment.
48  int _sockets;
49 
50  // If true, we were already asked to terminate.
51  bool _terminating;
52 
53 #ifdef HAVE_FORK
54  // the process that created this context. Used to detect forking.
55  pid_t _pid;
56 #endif
57 
59 };
60 }
61 
62 #endif
i_poll_events.hpp
zmq::socket_base_t
Definition: socket_base.hpp:31
zmq
Definition: zmq.hpp:229
poller.hpp
start
GLuint start
Definition: glcorearb.h:2858
ZMQ_NON_COPYABLE_NOR_MOVABLE
#define ZMQ_NON_COPYABLE_NOR_MOVABLE(classname)
Definition: macros.hpp:58
mailbox.hpp
zmq::ZMQ_FINAL::_sockets
int _sockets
Definition: reaper.hpp:48
object.hpp
ZMQ_FINAL
Definition: unittest_ip_resolver.cpp:26


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:58