ipc_listener.hpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MPL-2.0 */
2 
3 #ifndef __ZMQ_IPC_LISTENER_HPP_INCLUDED__
4 #define __ZMQ_IPC_LISTENER_HPP_INCLUDED__
5 
6 #if defined ZMQ_HAVE_IPC
7 
8 #include <string>
9 
10 #include "fd.hpp"
11 #include "stream_listener_base.hpp"
12 
13 namespace zmq
14 {
15 class ipc_listener_t ZMQ_FINAL : public stream_listener_base_t
16 {
17  public:
18  ipc_listener_t (zmq::io_thread_t *io_thread_,
19  zmq::socket_base_t *socket_,
20  const options_t &options_);
21 
22  // Set address to listen on.
23  int set_local_address (const char *addr_);
24 
25  protected:
26  std::string get_socket_name (fd_t fd_, socket_end_t socket_end_) const;
27 
28  private:
29  // Handlers for I/O events.
30  void in_event ();
31 
32  // Filter new connections if the OS provides a mechanism to get
33  // the credentials of the peer process. Called from accept().
34 #if defined ZMQ_HAVE_SO_PEERCRED || defined ZMQ_HAVE_LOCAL_PEERCRED
35  bool filter (fd_t sock_);
36 #endif
37 
38  int close ();
39 
40  // Accept the new connection. Returns the file descriptor of the
41  // newly created connection. The function may return retired_fd
42  // if the connection was dropped while waiting in the listen backlog.
43  fd_t accept ();
44 
45  // True, if the underlying file for UNIX domain socket exists.
46  bool _has_file;
47 
48  // Name of the temporary directory (if any) that has the
49  // UNIX domain socket
50  std::string _tmp_socket_dirname;
51 
52  // Name of the file associated with the UNIX domain address.
53  std::string _filename;
54 
55  ZMQ_NON_COPYABLE_NOR_MOVABLE (ipc_listener_t)
56 };
57 }
58 
59 #endif
60 
61 #endif
zmq::get_socket_name
std::string get_socket_name(fd_t fd_, socket_end_t socket_end_)
Definition: address.hpp:120
string
GLsizei const GLchar *const * string
Definition: glcorearb.h:3083
zmq::socket_base_t
Definition: socket_base.hpp:31
zmq
Definition: zmq.hpp:229
ZMQ_NON_COPYABLE_NOR_MOVABLE
#define ZMQ_NON_COPYABLE_NOR_MOVABLE(classname)
Definition: macros.hpp:58
fd.hpp
filter
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:3467
stream_listener_base.hpp
fd_t
zmq_fd_t fd_t
Definition: libzmq/tests/testutil.hpp:98
zmq::socket_end_t
socket_end_t
Definition: address.hpp:110
ZMQ_FINAL
Definition: unittest_ip_resolver.cpp:26
options_
DebugStringOptions options_
Definition: src/google/protobuf/descriptor.cc:2410


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