We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68496f8 commit 6476c08Copy full SHA for 6476c08
1 file changed
toolbelt/sockets.h
@@ -99,6 +99,8 @@ class InetAddress {
99
in_addr IpAddress() const { return {ntohl(addr_.sin_addr.s_addr)}; }
100
int Port() const { return ntohs(addr_.sin_port); }
101
102
+ in_addr IpAddressInNetworkOrder() const { return {addr_.sin_addr.s_addr}; }
103
+
104
// Port is in host byte order.
105
void SetPort(int port) { addr_.sin_port = htons(port); }
106
@@ -239,7 +241,7 @@ class SocketAddress {
239
241
return std::visit(
240
242
EyeOfNewt{
243
[](const InetAddress &a) {
- return SocketAddress(a.IpAddress(), 0);
244
+ return SocketAddress(a.IpAddressInNetworkOrder(), 0);
245
},
246
[](const VirtualAddress &a) { return SocketAddress(a.Cid(), 0); },
247
[](const std::string &a) { return SocketAddress(a); }},
0 commit comments