Commit 9cb9154b authored by Max Kellermann's avatar Max Kellermann

net/IPv4Address: add struct sockaddr_in constructor

parent 234a6193
...@@ -126,11 +126,14 @@ class IPv4Address { ...@@ -126,11 +126,14 @@ class IPv4Address {
public: public:
IPv4Address() = default; IPv4Address() = default;
constexpr IPv4Address(const struct sockaddr_in &_address) noexcept
:address(_address) {}
/** /**
* @param port the port number in host byte order * @param port the port number in host byte order
*/ */
constexpr IPv4Address(struct in_addr _address, uint16_t port) noexcept constexpr IPv4Address(struct in_addr _address, uint16_t port) noexcept
:address(Construct(_address, port)) {} :IPv4Address(Construct(_address, port)) {}
/** /**
* @param port the port number in host byte order * @param port the port number in host byte order
......
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