class Poco::Net::HostEntry

Overview

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

#include <HostEntry.h>

class HostEntry
{
public:
    // typedefs

    typedef std::vector<std::string> AliasList;
    typedef std::vector<IPAddress> AddressList;

    // construction

    HostEntry();
    HostEntry(struct hostent* entry);
    HostEntry(const HostEntry& entry);

    // methods

    HostEntry&
    operator=(const HostEntry& entry);

    void
    swap(HostEntry& hostEntry);

    const std::string&
    name() const;

    const AliasList&
    aliases() const;

    const AddressList&
    addresses() const;
};

Detailed Documentation

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

Construction

HostEntry()

Creates an empty HostEntry.

HostEntry(struct hostent* entry)

Creates the HostEntry from the data in a hostent structure.

HostEntry(const HostEntry& entry)

Creates the HostEntry by copying another one.

Methods

HostEntry&
operator=(const HostEntry& entry)

Assigns another HostEntry.

void
swap(HostEntry& hostEntry)

Swaps the HostEntry with another one.

const std::string&
name() const

Returns the canonical host name.

const AliasList&
aliases() const

Returns a vector containing alias names for the host name.

const AddressList&
addresses() const

Returns a vector containing the IPAddresses for the host.