MySQL 8.0.39
Source Code Documentation
net::ip::basic_endpoint< InternetProtocol > Class Template Reference

#include <internet.h>

Public Types

using protocol_type = InternetProtocol
 
using size_type = size_t
 

Public Member Functions

constexpr basic_endpoint ()
 default constructor. More...
 
constexpr basic_endpoint (const protocol_type &proto, port_type port_num) noexcept
 construct from protocol and port-number. More...
 
constexpr basic_endpoint (const ip::address &addr, port_type port_num) noexcept
 construct from address and port-number. More...
 
constexpr protocol_type protocol () const noexcept
 get protocol of the endpoint. More...
 
constexpr ip::address address () const noexcept
 get address of the endpoint. More...
 
constexpr port_type port () const noexcept
 get port of the endpoint. More...
 
const void * data () const noexcept
 const pointer to the underlying sockaddr. More...
 
void * data () noexcept
 pointer to the underlying sockaddr. More...
 
constexpr size_type size () const noexcept
 size of the underlying sockaddr. More...
 
constexpr size_t capacity () const noexcept
 get capacity of the underlying sockaddr. More...
 
void resize (size_type n)
 set the size of valid data of the underlying sockaddr. More...
 

Private Attributes

union {
   sockaddr_in   v4
 
   sockaddr_in6   v6
 
data_
 

Member Typedef Documentation

◆ protocol_type

template<typename InternetProtocol >
using net::ip::basic_endpoint< InternetProtocol >::protocol_type = InternetProtocol

◆ size_type

template<typename InternetProtocol >
using net::ip::basic_endpoint< InternetProtocol >::size_type = size_t

Constructor & Destructor Documentation

◆ basic_endpoint() [1/3]

template<typename InternetProtocol >
constexpr net::ip::basic_endpoint< InternetProtocol >::basic_endpoint ( )
inlineconstexpr

default constructor.

protocol() is v4()

◆ basic_endpoint() [2/3]

template<typename InternetProtocol >
constexpr net::ip::basic_endpoint< InternetProtocol >::basic_endpoint ( const protocol_type proto,
port_type  port_num 
)
inlineconstexprnoexcept

construct from protocol and port-number.

basic_endpoint(v4(), 80).

◆ basic_endpoint() [3/3]

template<typename InternetProtocol >
constexpr net::ip::basic_endpoint< InternetProtocol >::basic_endpoint ( const ip::address addr,
port_type  port_num 
)
inlineconstexprnoexcept

construct from address and port-number.

Member Function Documentation

◆ address()

template<typename InternetProtocol >
constexpr ip::address net::ip::basic_endpoint< InternetProtocol >::address ( ) const
inlineconstexprnoexcept

get address of the endpoint.

◆ capacity()

template<typename InternetProtocol >
constexpr size_t net::ip::basic_endpoint< InternetProtocol >::capacity ( ) const
inlineconstexprnoexcept

get capacity of the underlying sockaddr.

◆ data() [1/2]

template<typename InternetProtocol >
const void * net::ip::basic_endpoint< InternetProtocol >::data ( ) const
inlinenoexcept

const pointer to the underlying sockaddr.

◆ data() [2/2]

template<typename InternetProtocol >
void * net::ip::basic_endpoint< InternetProtocol >::data ( )
inlinenoexcept

pointer to the underlying sockaddr.

◆ port()

template<typename InternetProtocol >
constexpr port_type net::ip::basic_endpoint< InternetProtocol >::port ( ) const
inlineconstexprnoexcept

get port of the endpoint.

◆ protocol()

template<typename InternetProtocol >
constexpr protocol_type net::ip::basic_endpoint< InternetProtocol >::protocol ( ) const
inlineconstexprnoexcept

get protocol of the endpoint.

◆ resize()

template<typename InternetProtocol >
void net::ip::basic_endpoint< InternetProtocol >::resize ( size_type  n)
inline

set the size of valid data of the underlying sockaddr.

basic_endpoint<tcp> ep;
if (addrlen < ep.capacity()) {
memcpy(ep.data(), addr, addrlen);
ep.resize(addrlen);
}
Parameters
nnew size
Exceptions
std::length_errorif n > capacity

◆ size()

template<typename InternetProtocol >
constexpr size_type net::ip::basic_endpoint< InternetProtocol >::size ( ) const
inlineconstexprnoexcept

size of the underlying sockaddr.

Member Data Documentation

◆ 

union { ... } net::ip::basic_endpoint< InternetProtocol >::data_

◆ v4

template<typename InternetProtocol >
sockaddr_in net::ip::basic_endpoint< InternetProtocol >::v4

◆ v6

template<typename InternetProtocol >
sockaddr_in6 net::ip::basic_endpoint< InternetProtocol >::v6

The documentation for this class was generated from the following file: