libzmq
src
udp_engine.hpp
Go to the documentation of this file.
1
2
#ifndef __ZMQ_UDP_ENGINE_HPP_INCLUDED__
3
#define __ZMQ_UDP_ENGINE_HPP_INCLUDED__
4
5
#include "
io_object.hpp
"
6
#include "
i_engine.hpp
"
7
#include "
address.hpp
"
8
#include "
msg.hpp
"
9
10
#define MAX_UDP_MSG 8192
11
12
namespace
zmq
13
{
14
class
io_thread_t;
15
class
session_base_t;
16
17
class
udp_engine_t
ZMQ_FINAL
:
public
io_object_t,
public
i_engine
18
{
19
public
:
20
udp_engine_t (
const
options_t &
options_
);
21
~udp_engine_t ();
22
23
int
init
(address_t *address_,
bool
send_,
bool
recv_);
24
25
bool
has_handshake_stage
()
ZMQ_FINAL
{
return
false
; };
26
27
// i_engine interface implementation.
28
// Plug the engine to the session.
29
void
plug (zmq::io_thread_t *io_thread_,
class
session_base_t
*session_);
30
31
// Terminate and deallocate the engine. Note that 'detached'
32
// events are not fired on termination.
33
void
terminate ();
34
35
// This method is called by the session to signalise that more
36
// messages can be written to the pipe.
37
bool
restart_input ();
38
39
// This method is called by the session to signalise that there
40
// are messages to send available.
41
void
restart_output ();
42
43
void
zap_msg_available
(){};
44
45
void
in_event ();
46
void
out_event ();
47
48
const
endpoint_uri_pair_t
&get_endpoint ()
const
;
49
50
private
:
51
int
resolve_raw_address (
const
char
*
name_
,
size_t
length_);
52
static
void
sockaddr_to_msg (
zmq::msg_t
*msg_,
const
sockaddr_in *addr_);
53
54
static
int
set_udp_reuse_address (
fd_t
s_
,
bool
on_);
55
static
int
set_udp_reuse_port (
fd_t
s_
,
bool
on_);
56
// Indicate, if the multicast data being sent should be looped back
57
static
int
set_udp_multicast_loop (
fd_t
s_
,
bool
is_ipv6_,
bool
loop_);
58
// Set multicast TTL
59
static
int
set_udp_multicast_ttl (
fd_t
s_
,
bool
is_ipv6_,
int
hops_);
60
// Set multicast address/interface
61
int
set_udp_multicast_iface (
fd_t
s_
,
62
bool
is_ipv6_,
63
const
udp_address_t
*addr_);
64
// Join a multicast group
65
int
add_membership (
fd_t
s_
,
const
udp_address_t
*addr_);
66
67
// Function to handle network issues.
68
void
error
(error_reason_t reason_);
69
70
const
endpoint_uri_pair_t
_empty_endpoint
;
71
72
bool
_plugged
;
73
74
fd_t
_fd
;
75
session_base_t
*
_session
;
76
handle_t
_handle
;
77
address_t
*
_address
;
78
79
options_t
_options
;
80
81
sockaddr_in
_raw_address
;
82
const
struct
sockaddr *
_out_address
;
83
zmq_socklen_t
_out_address_len
;
84
85
char
_out_buffer[
MAX_UDP_MSG
];
86
char
_in_buffer[
MAX_UDP_MSG
];
87
bool
_send_enabled
;
88
bool
_recv_enabled
;
89
};
90
}
91
92
#endif
zmq::ZMQ_FINAL
Definition:
channel.hpp:17
zmq::session_base_t
Definition:
session_base.hpp:21
init
WEPOLL_INTERNAL int init(void)
Definition:
wepoll.c:858
zmq::options_t
Definition:
options.hpp:34
zmq::ZMQ_FINAL::_options
options_t _options
Definition:
udp_engine.hpp:79
zmq::ZMQ_FINAL::_empty_endpoint
const endpoint_uri_pair_t _empty_endpoint
Definition:
udp_engine.hpp:70
error
Definition:
cJSON.c:88
zmq::ZMQ_FINAL::_out_address_len
zmq_socklen_t _out_address_len
Definition:
udp_engine.hpp:83
zmq::fd_t
int fd_t
Definition:
zmq.hpp:287
zmq::ZMQ_FINAL::_plugged
bool _plugged
Definition:
udp_engine.hpp:72
zmq::udp_address_t
Definition:
udp_address.hpp:17
zmq
Definition:
zmq.hpp:229
zmq::ZMQ_FINAL::_recv_enabled
bool _recv_enabled
Definition:
udp_engine.hpp:88
zmq::endpoint_uri_pair_t
Definition:
endpoint.hpp:17
zmq::ZMQ_FINAL::_out_address
const struct sockaddr * _out_address
Definition:
udp_engine.hpp:82
s_
std::string s_
Definition:
gmock-matchers_test.cc:4128
zmq::ZMQ_FINAL::_send_enabled
bool _send_enabled
Definition:
udp_engine.hpp:87
name_
string name_
Definition:
googletest.cc:182
address.hpp
zmq::ZMQ_FINAL::_address
address_t * _address
Definition:
udp_engine.hpp:77
msg.hpp
zmq::ZMQ_FINAL::_handle
handle_t _handle
Definition:
udp_engine.hpp:76
zmq::address_t
Definition:
address.hpp:64
io_object.hpp
zmq::ZMQ_FINAL::_session
session_base_t * _session
Definition:
udp_engine.hpp:75
zmq::zmq_socklen_t
socklen_t zmq_socklen_t
Definition:
address.hpp:107
zmq::ZMQ_FINAL::_fd
fd_t _fd
Definition:
udp_engine.hpp:74
MAX_UDP_MSG
#define MAX_UDP_MSG
Definition:
udp_engine.hpp:10
zmq::ZMQ_FINAL::zap_msg_available
void zap_msg_available()
Definition:
udp_engine.hpp:43
zmq::ZMQ_FINAL::has_handshake_stage
bool has_handshake_stage() ZMQ_FINAL
Definition:
udp_engine.hpp:25
zmq::ZMQ_FINAL::_raw_address
sockaddr_in _raw_address
Definition:
udp_engine.hpp:81
i_engine.hpp
ZMQ_FINAL
Definition:
unittest_ip_resolver.cpp:26
zmq::msg_t
Definition:
msg.hpp:33
options_
DebugStringOptions options_
Definition:
src/google/protobuf/descriptor.cc:2410
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:00