| D++ (DPP) C++ Discord API Bot Library

Search
Loading...
Searching...
No Matches
dpp::dns_cache_entry Struct Reference

Represents a cached DNS result. Used by the ssl_connection class to store cached copies of dns lookups. More...

`#include <dns.h>`

Collaboration diagram for dpp::dns_cache_entry:
[legend]

## Public Member Functions

const address_t | get_connecting_address (uint16_t port) const
| Get the address_t that corresponds to this cache entry for use when connecting with ::connect().
socket | make_connecting_socket () const
| Allocate a socket file descriptor for the given dns address.
int | size () const
| Get address length.

## Public Attributes

addrinfo | addr
| Resolved address metadata.
time_t | expire_timestamp
| Time at which this cache entry is invalidated.
std::string | resolved_addr
| Resolved address as string. The metadata is needed to know what type of address it is. Do not do silly stuff like just looking to see if '.' is in it!

## Detailed Description

Represents a cached DNS result. Used by the ssl_connection class to store cached copies of dns lookups.

## Member Function Documentation

## ◆ get_connecting_address()

const address_t dpp::dns_cache_entry::get_connecting_address | ( | uint16_t | port | ) | const

nodiscard

Get the address_t that corresponds to this cache entry for use when connecting with ::connect().

Parameters

  port | Port number to connect to

Returns
  address_t prefilled with the IP and port number

## ◆ make_connecting_socket()

socket dpp::dns_cache_entry::make_connecting_socket | ( |  | ) | const

nodiscard

Allocate a socket file descriptor for the given dns address.

Returns
  File descriptor ready for calling connect(), or INVALID_SOCKET on failure.

## ◆ size()

int dpp::dns_cache_entry::size | ( |  | ) | const

nodiscard

Get address length.

Returns
  address length

## Member Data Documentation

## ◆ addr

addrinfo dpp::dns_cache_entry::addr

Resolved address metadata.

## ◆ expire_timestamp

time_t dpp::dns_cache_entry::expire_timestamp

Time at which this cache entry is invalidated.

## ◆ resolved_addr

std::string dpp::dns_cache_entry::resolved_addr

Resolved address as string. The metadata is needed to know what type of address it is. Do not do silly stuff like just looking to see if '.' is in it!

D++ Library version 9.0.13 D++ Library version 9.0.12 D++ Library version 9.0.11 D++ Library version 9.0.10 D++ Library version 9.0.9 D++ Library version 9.0.8 D++ Library version 9.0.7 D++ Library version 9.0.6 D++ Library version 9.0.5 D++ Library version 9.0.4 D++ Library version 9.0.3 D++ Library version 9.0.2 D++ Library version 9.0.1 D++ Library version 9.0.0 D++ Library version 1.0.2 D++ Library version 1.0.1 D++ Library version 1.0.0