Commit c30466b8 authored by Max Kellermann's avatar Max Kellermann Committed by Max Kellermann

net/IPv4Address: add method GetPortBE()

parent 868f1a44
...@@ -188,10 +188,17 @@ public: ...@@ -188,10 +188,17 @@ public:
} }
/** /**
* @return the port number in network byte order
*/
constexpr uint16_t GetPortBE() const noexcept {
return address.sin_port;
}
/**
* @return the port number in host byte order * @return the port number in host byte order
*/ */
constexpr uint16_t GetPort() const noexcept { constexpr uint16_t GetPort() const noexcept {
return FromBE16(address.sin_port); return FromBE16(GetPortBE());
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment