17#ifndef TOOLBOX_NET_SOCKET_HPP
18#define TOOLBOX_NET_SOCKET_HPP
26#include <netinet/tcp.h>
36 std::error_code&
ec)
noexcept
53 "getaddrinfo (" + std::string{
node ?
node :
""} +
")"};
60 int protocol, std::error_code&
ec)
noexcept
65 hints.ai_family = family;
66 hints.ai_socktype = type;
67 hints.ai_protocol = protocol;
78 hints.ai_family = family;
79 hints.ai_socktype = type;
80 hints.ai_protocol = protocol;
85template <
typename ProtocolT>
87 std::error_code&
ec)
noexcept
93template <
typename ProtocolT>
144template <
typename ProtocolT>
147 return socket(protocol.family(), protocol.type(), protocol.protocol(),
ec);
151template <
typename ProtocolT>
154 return socket(protocol.family(), protocol.type(), protocol.protocol());
158inline std::pair<FileHandle, FileHandle>
socketpair(
int family,
int type,
int protocol,
159 std::error_code&
ec)
noexcept
169inline std::pair<FileHandle, FileHandle>
socketpair(
int family,
int type,
int protocol)
179template <
typename ProtocolT>
181 std::error_code&
ec)
noexcept
183 return socketpair(protocol.family(), protocol.type(), protocol.protocol(),
ec);
187template <
typename ProtocolT>
190 return socketpair(protocol.family(), protocol.type(), protocol.protocol());
195 std::error_code&
ec)
noexcept
239template <
typename Endpo
intT>
245 ep.resize(std::min<std::size_t>(
addrlen,
ep.capacity()));
251template <
typename Endpo
intT>
256 ep.resize(std::min<std::size_t>(
addrlen,
ep.capacity()));
277template <
typename Endpo
intT>
284template <
typename Endpo
intT>
292 std::error_code&
ec)
noexcept
308template <
typename Endpo
intT>
315template <
typename Endpo
intT>
412template <
typename Endpo
intT>
414 std::error_code&
ec)
noexcept
419 ep.resize(std::min<std::size_t>(
addrlen,
ep.capacity()));
425template <
typename Endpo
intT>
430 ep.resize(std::min<std::size_t>(
addrlen,
ep.capacity()));
435template <
typename Endpo
intT>
437 std::error_code&
ec)
noexcept
443template <
typename Endpo
intT>
451 std::error_code&
ec)
noexcept
505template <
typename Endpo
intT>
507 std::error_code& )
noexcept
513template <
typename Endpo
intT>
521template <
typename Endpo
intT>
523 std::error_code&
ec)
noexcept
530template <
typename Endpo
intT>
539 std::error_code&
ec)
noexcept
559template <
typename Endpo
intT>
565 ep.resize(std::min<std::size_t>(
addrlen,
ep.capacity()));
570template <
typename Endpo
intT>
575 ep.resize(std::min<std::size_t>(
addrlen,
ep.capacity()));
580 std::error_code&
ec)
noexcept
597 std::error_code&
ec)
noexcept
613inline namespace net {
618template <
typename Endpo
intT>
624template <
typename Endpo
intT>