2 +--------------------------------------------------------------------+
3 | libmemcached - C/C++ Client Library for memcached |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted under the terms of the BSD license. |
7 | You should have received a copy of the license in a bundled file |
8 | named LICENSE; in case you did not receive a copy you can review |
9 | the terms online at: https://opensource.org/licenses/BSD-3-Clause |
10 +--------------------------------------------------------------------+
11 | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ |
12 | Copyright (c) 2020 Michael Wallner <mike@php.net> |
13 +--------------------------------------------------------------------+
20 #include <sys/socket.h>
21 #include <netinet/in.h>
26 explicit Connection(socket_or_port_t socket_or_port);
29 friend void swap(Connection &a, Connection &b);
30 void swap(Connection &conn);
32 Connection(const Connection &conn);
33 Connection &operator=(const Connection &conn);
35 Connection(Connection &&conn) noexcept;
36 Connection &operator=(Connection &&conn) noexcept;
48 int sock{-1}, last_err{-1};
49 sockaddr_storage addr{};
52 UNIX = sizeof(sockaddr_un),
53 INET = sizeof(sockaddr_in),
54 INET6 = sizeof(sockaddr_in6)
56 bool connected{false};
58 static string error(const initializer_list<string> &args);