Poco::Net

class HostEntry

Library: Net
Package: NetCore
Header: Poco/Net/HostEntry.h

Description

This class stores information about a host such as host name, alias names and a list of IP addresses.

Member Summary

Member Functions: addresses, aliases, name, operator =, swap

Types Aliases

AddressList

using AddressList = std::vector < IPAddress >;

AliasList

using AliasList = std::vector < std::string >;

Constructors

HostEntry

HostEntry();

Creates an empty HostEntry.

HostEntry

HostEntry(
    struct hostent * entry
);

Creates the HostEntry from the data in a hostent structure.

HostEntry

HostEntry(
    struct addrinfo * info
);

Creates the HostEntry from the data in an addrinfo structure.

HostEntry

HostEntry(
    const HostEntry & entry
);

Creates the HostEntry by copying another one.

Destructor

~HostEntry

~HostEntry();

Destroys the HostEntry.

Member Functions

addresses inline

const AddressList & addresses() const;

Returns a vector containing the IPAddresses for the host.

aliases inline

const AliasList & aliases() const;

Returns a vector containing alias names for the host name.

name inline

const std::string & name() const;

Returns the canonical host name.

operator =

HostEntry & operator = (
    const HostEntry & entry
);

Assigns another HostEntry.

swap

void swap(
    HostEntry & hostEntry
);

Swaps the HostEntry with another one.