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);
100 [[nodiscard]] size_t WriteAll(std::initializer_list<IoData> list,
101 Deadline deadline)
override {
102 return SendAll(list, deadline);
166 return RecvSome(buf, len, deadline);
173 return RecvAll(buf, len, deadline);
184 return RecvNoblock(buf, len);
191 return SendAll(buf, len, deadline);
197 impl::FdControlHolder fd_control_;