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);
92 [[nodiscard]] size_t WriteAll(std::initializer_list<IoData> list,
93 Deadline deadline)
override {
94 return SendAll(list, deadline);
158 return RecvSome(buf, len, deadline);
165 return RecvAll(buf, len, deadline);
172 return SendAll(buf, len, deadline);
178 impl::FdControlHolder fd_control_;