5 #include <sys/socket.h>
10 explicit Connection(socket_or_port_t socket_or_port);
13 friend void swap(Connection &a, Connection &b);
14 void swap(Connection &conn);
16 Connection(const Connection &conn);
17 Connection &operator = (const Connection &conn);
19 Connection(Connection &&conn) noexcept ;
20 Connection &operator = (Connection &&conn) noexcept ;
32 int sock{-1}, last_err{-1};
33 sockaddr_storage addr{0, {0}, 0};
36 UNIX = sizeof(sockaddr_un),
37 INET = sizeof(sockaddr_in),
38 INET6 = sizeof(sockaddr_in6)
40 bool connected{false};
42 static string error(const initializer_list<string> &args);