Handle listen/accept/send/receive in afd_endpoint

This commit is contained in:
Igor Pissolati
2025-05-20 00:56:22 -03:00
parent 0f4cc3365c
commit f5ed0752e3
9 changed files with 412 additions and 11 deletions

View File

@@ -47,6 +47,8 @@ namespace network
bool is_valid() const;
bool bind(const address& target);
bool listen(int backlog);
SOCKET accept(address& address);
bool set_blocking(bool blocking);
static bool set_blocking(SOCKET s, bool blocking);
@@ -62,6 +64,7 @@ namespace network
int get_address_family() const;
bool is_ready(bool in_poll) const;
bool is_listening() const;
static bool sleep_sockets(const std::span<const socket*>& sockets, std::chrono::milliseconds timeout,
bool in_poll);
@@ -74,5 +77,6 @@ namespace network
private:
SOCKET socket_ = INVALID_SOCKET;
bool listening_{};
};
}