12 #ifndef ROC_NETIO_UDP_RECEIVER_PORT_H_
13 #define ROC_NETIO_UDP_RECEIVER_PORT_H_
58 uv_loop_t& event_loop,
80 static void close_cb_(uv_handle_t* handle);
81 static void alloc_cb_(uv_handle_t* handle,
size_t size, uv_buf_t* buf);
82 static void recv_cb_(uv_udp_t* handle,
88 bool join_multicast_group_();
89 void leave_multicast_group_();
95 void* close_handler_arg_;
100 bool handle_initialized_;
102 bool multicast_group_joined_;
109 unsigned packet_counter_;
IArena & arena() const
Get arena.
UdpReceiverPort(const UdpReceiverConfig &config, packet::IWriter &writer, uv_loop_t &event_loop, packet::PacketFactory &packet_factory, core::BufferFactory< uint8_t > &buffer_factory, core::IArena &arena)
Initialize.
virtual ~UdpReceiverPort()
Destroy.
virtual void format_descriptor(core::StringBuilder &b)
Format descriptor.
virtual AsyncOperationStatus async_close(ICloseHandler &handler, void *handler_arg)
Asynchronously close receiver.
const address::SocketAddr & bind_address() const
Get bind address.
virtual bool open()
Open receiver.
Intrusive doubly-linked list.
AsyncOperationStatus
Asynchronous operation status.
bool reuseaddr
If set, enable SO_REUSEADDR when binding socket to non-ephemeral port. If not set,...
address::SocketAddr bind_address
Receiver will bind to this address. If IP is zero, INADDR_ANY is used, i.e. the socket is bound to al...
char multicast_interface[64]
If not empty, receiver will join multicast group on the interface with given address....