Resolve client host name using DNS.

This operation is blocking and should be made asynchronous.
This commit is contained in:
Bartosz Taudul 2019-06-21 19:27:41 +02:00
parent 659ef87974
commit 48df667a37
2 changed files with 2 additions and 2 deletions

View File

@ -437,7 +437,7 @@ IpAddress::~IpAddress()
void IpAddress::Set( const struct sockaddr& addr )
{
auto ai = (const struct sockaddr_in*)&addr;
inet_ntop( AF_INET, &ai->sin_addr, m_text, 17 );
getnameinfo( &addr, sizeof( sockaddr_in ), m_text, 64, nullptr, 0, NI_NOFQDN );
m_number = ai->sin_addr.s_addr;
}

View File

@ -103,7 +103,7 @@ public:
private:
uint32_t m_number;
char m_text[17];
char m_text[64];
};
class UdpListen