12 #ifndef ROC_NETIO_UDP_SENDER_PORT_H_
13 #define ROC_NETIO_UDP_SENDER_PORT_H_
62 uv_loop_t& event_loop,
87 static void close_cb_(uv_handle_t* handle);
88 static void write_sem_cb_(uv_async_t* handle);
89 static void send_cb_(uv_udp_send_t* req,
int status);
93 bool fully_closed_()
const;
94 void start_closing_();
102 void* close_handler_arg_;
106 uv_async_t write_sem_;
107 bool write_sem_initialized_;
110 bool handle_initialized_;
#define ROC_ATTR_NODISCARD
Emit warning if function result is not checked.
IArena & arena() const
Get arena.
Thread-safe lock-free node-based intrusive multi-producer single-consumer queue.
virtual AsyncOperationStatus async_close(ICloseHandler &handler, void *handler_arg)
Asynchronously close sender.
virtual ROC_ATTR_NODISCARD status::StatusCode write(const packet::PacketPtr &)
Write packet.
virtual bool open()
Open sender.
const address::SocketAddr & bind_address() const
Get bind address.
virtual void format_descriptor(core::StringBuilder &b)
Format descriptor.
UdpSenderPort(const UdpSenderConfig &config, uv_loop_t &event_loop, core::IArena &arena)
Initialize.
Multi-producer single-consumer queue.
AsyncOperationStatus
Asynchronous operation status.
bool non_blocking_enabled
If true, allow non-blocking writes directly in write() method. If non-blocking write can't be perform...
address::SocketAddr bind_address
Sender will bind to this address. If IP is zero, INADDR_ANY is used, i.e. the socket is bound to all ...
bool operator==(const UdpSenderConfig &other) const
Check two configs for equality.
bool reuseaddr
If set, enable SO_REUSEADDR when binding socket to non-ephemeral port. If not set,...