fixed conversion for IpAddr

This commit is contained in:
Erik Frojdh
2020-01-16 16:31:11 +01:00
parent f3598c1f39
commit c1fac7cdb7
5 changed files with 12 additions and 12 deletions

View File

@ -12,8 +12,8 @@ class IpAddr {
public:
constexpr IpAddr() noexcept = default;
explicit constexpr IpAddr(uint32_t address) noexcept : addr_{address} {}
IpAddr(const std::string &address);
IpAddr(const char *address);
explicit IpAddr(const std::string &address);
explicit IpAddr(const char *address);
std::string str() const;
std::string hex() const;
std::array<char, 16u> arr() const;

View File

@ -48,7 +48,7 @@ ServerInterface2 ServerSocket::accept() {
}
char tc[INET_ADDRSTRLEN]{};
inet_ntop(AF_INET, &(clientAddr.sin_addr), tc, INET_ADDRSTRLEN);
thisClient = tc;
thisClient = IpAddr{tc};
return ServerInterface2(newSocket);
}