8#include <initializer_list>
10#include <userver/engine/deadline.hpp>
11#include <userver/engine/io/common.hpp>
12#include <userver/engine/io/exception.hpp>
13#include <userver/engine/io/fd_control_holder.hpp>
14#include <userver/engine/io/sockaddr.hpp>
18USERVER_NAMESPACE_BEGIN
37class [[nodiscard]] Socket
final :
public RwBase {
40 size_t bytes_received{0};
66 void Bind(
const Sockaddr&);
69 void Listen(
int backlog = SOMAXCONN);
99 [[nodiscard]] size_t WriteAll(std::initializer_list<IoData> list, Deadline deadline)
override {
100 return SendAll(list, deadline);
159 return RecvSome(buf, len, deadline);
165 return RecvAll(buf, len, deadline);
179 return SendAll(buf, len, deadline);
185 impl::FdControlHolder fd_control_;