Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
0blu committed Sep 16, 2024
1 parent 96cdcc4 commit 81f134e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/shared/IO/Networking/IpAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ IO::Networking::IpAddress::Type IO::Networking::IpAddress::getType() const
return m_address.type;
}

/// "127.0.0.1" would return 2130706433
uint32_t IO::Networking::IpAddress::_getInternalIPv4ReprAsUint32() const
{
MANGOS_ASSERT(m_address.type == Type::IPv4);
Expand Down
3 changes: 2 additions & 1 deletion src/shared/IO/Networking/IpAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ namespace IO { namespace Networking

Type getType() const;

/// "127.0.0.1" would return 2130706433
uint32_t _getInternalIPv4ReprAsUint32() const;
private:
struct
{
Type type = Type::IPv4;
union
{
uint32_t ipv4;
uint32_t ipv4; // IPv4 address in
std::array<uint16_t, 8> ipv6; // index[0] is leftmost element in string representation
};
} m_address;
Expand Down

0 comments on commit 81f134e

Please sign in to comment.