6#ifndef OPENCBDC_TX_SRC_NETWORK_SOCKET_SELECTOR_H_
7#define OPENCBDC_TX_SRC_NETWORK_SOCKET_SELECTOR_H_
54 std::array<int, 2> m_unblock_fds{-1, -1};
56 auto add(
int fd) -> bool;
Waits on a group of blocking sockets to be ready for read operations.
socket_selector()=default
Constructs an empty socket selector.
socket_selector(const socket_selector &)=delete
auto operator=(socket_selector &&) -> socket_selector &=delete
socket_selector(socket_selector &&)=delete
auto add(const socket &sock) -> bool
Adds a socket to the selector so that it is checked for events after a call to wait.
auto wait() -> bool
Blocks until at least one socket in the selector is ready to perform a read operation.
void unblock()
Unblocks a blocked wait() call.
auto init() -> bool
Sets-up the socket selector.
auto operator=(const socket_selector &) -> socket_selector &=delete
Generic superclass for network sockets.