99 std::chrono::milliseconds timeout);
102class Socket :
public MoveOnly {
115 Socket(Socket&& other) noexcept : handle_(std::exchange(other.handle_, kInvalidSocket)) {}
117 Socket& operator=(Socket&& other)
noexcept {
118 if (
this != &other) {
120 handle_ = std::exchange(other.handle_, kInvalidSocket);
132 bool IsValid()
const {
return handle_ != kInvalidSocket; }
198 REX_API i32
RecvFrom(
void* buf, i32 len, i32 flags, sockaddr* from, i32* from_len)
const;
213 REX_API i32
SendTo(
const void* buf, i32 len, i32 flags,
const sockaddr* to, i32 to_len)
const;
259 SocketClose(std::exchange(handle_, kInvalidSocket));
constexpr bool is_flags_enum
Definition bit.h:422
Wait objects and wait functions.
Integer types, byte order wrappers and size literals.
Move only function, const propagating pointer and scope guard.