diff options
Diffstat (limited to 'src/network/core/address.h')
-rw-r--r-- | src/network/core/address.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/network/core/address.h b/src/network/core/address.h index eea66cabb..30e79f7a4 100644 --- a/src/network/core/address.h +++ b/src/network/core/address.h @@ -64,6 +64,18 @@ public: } /** + * Create a network address based on a resolved IP and port + * @param address the IP address with port + */ + NetworkAddress(sockaddr *address, size_t address_length) : + hostname(NULL), + address_length(address_length) + { + memset(&this->address, 0, sizeof(this->address)); + memcpy(&this->address, address, address_length); + } + + /** * Create a network address based on a unresolved host and port * @param ip the unresolved hostname * @param port the port |