dpp::socket_events
socketengine.h
dpp::socket dpp::socket dpp::socket_events::fd fd dpp::socket_events::fd {INVALID_SOCKET}

File descriptor.

This should be a valid file descriptor created via ::socket().

uint8_t uint8_t dpp::socket_events::flags flags dpp::socket_events::flags {0}

Flag bit mask of values from dpp::socket_event_flags.

socket_error_event socket_error_event dpp::socket_events::on_error on_error dpp::socket_events::on_error {}

Error event.

This function will be called from a different thread to that which adds the event set to the socket engine.

socket_read_event socket_read_event dpp::socket_events::on_read on_read dpp::socket_events::on_read {}

Read ready event.

This function will be called from a different thread to that which adds the event set to the socket engine.

socket_write_event socket_write_event dpp::socket_events::on_write on_write dpp::socket_events::on_write {}

Write ready event.

This function will be called from a different thread to that which adds the event set to the socket engine.

dpp::socket_events::socket_events
()=default
socket_events
dpp::socket_events::socket_events

Default constructor.

dpp::socket_events::socket_events
(dpp::socket socket_fd, uint8_t _flags, const socket_read_event &read_event, const socket_write_event &write_event={}, const socket_error_event &error_event={})
socket_events
dpp::socket_events::socket_events
dpp::socket socket_fd
uint8_t _flags
const socket_read_event & read_event
const socket_write_event & write_event {}
const socket_error_event & error_event {}

Construct a new socket_events.

socket_fd

file descriptor

_flags

initial flags bitmask

read_event

read ready event

write_event

write ready event

error_event

error event

Represents an active socket event set in the socket engine.

An event set contains a file descriptor, a set of event handler callbacks, and a set of bitmask flags which indicate which events it wants to receive. It is possible to quickly toggle event types on or off, as it is not always necessary or desired to receive all events all the time, in fact doing so can cause an event storm which will consume 100% CPU (e.g. if you request to receive write events all the time).

dpp::socket_events
fd
flags
on_read
on_write
on_error
int
function< void(dpp::socket fd, const struct socket_events &)>
function< void(dpp::socket fd, const struct socket_events &, int error_code)>
uint8_t
- dpp::socket_events
  fd
- dpp::socket_events
  flags
- dpp::socket_events
  on_error
- dpp::socket_events
  on_read
- dpp::socket_events
  on_write
- dpp::socket_events
  socket_events
- dpp::socket_events
  socket_events