StormByte C++ Library: Network module 0.0.9999
StormByte-Network is a StormByte library module for handling and create network connections
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
StormByte::Network::Connection::Info Class Reference

The class representing the connection information. More...

#include <info.hxx>

Public Member Functions

 Info (const Info &other) noexcept=delete
 The copy constructor of the Info class.
 
 Info (Info &&other) noexcept=default
 The move constructor of the Info class.
 
 ~Info () noexcept=default
 The destructor of the Info class.
 
Infooperator= (const Info &other) noexcept=delete
 The assignment operator of the Info class.
 
Infooperator= (Info &&other) noexcept=default
 The move assignment operator of the Info class.
 
constexpr const std::string & IP () const noexcept
 The function to get the IP address.
 
constexpr const unsigned short & Port () const noexcept
 The function to get the port.
 
std::shared_ptr< const sockaddr > SockAddr () const noexcept
 The function to get the socket address.
 

Static Public Member Functions

static StormByte::Expected< Info, ExceptionFromHost (const std::string &hostname, const unsigned short &port, const Protocol &protocol, std::shared_ptr< const Handler > handler) noexcept
 The function to create a connection info from a host.
 
static StormByte::Expected< Info, ExceptionFromSockAddr (std::shared_ptr< sockaddr > sockaddr) noexcept
 The function to create a connection info from a socket address.
 

Detailed Description

The class representing the connection information.

Constructor & Destructor Documentation

◆ Info() [1/2]

StormByte::Network::Connection::Info::Info ( const Info other)
deletenoexcept

The copy constructor of the Info class.

Parameters
otherThe other Info to copy.

◆ Info() [2/2]

StormByte::Network::Connection::Info::Info ( Info &&  other)
defaultnoexcept

The move constructor of the Info class.

Parameters
otherThe other Info to move.

Member Function Documentation

◆ FromHost()

static StormByte::Expected< Info, Exception > StormByte::Network::Connection::Info::FromHost ( const std::string &  hostname,
const unsigned short &  port,
const Protocol &  protocol,
std::shared_ptr< const Handler handler 
)
staticnoexcept

The function to create a connection info from a host.

Parameters
hostnameThe hostname of the connection.
portThe port of the connection.
protocolThe protocol of the connection.
handlerThe connection handler.
Returns
The expected connection info or error.

◆ FromSockAddr()

static StormByte::Expected< Info, Exception > StormByte::Network::Connection::Info::FromSockAddr ( std::shared_ptr< sockaddr >  sockaddr)
staticnoexcept

The function to create a connection info from a socket address.

Parameters
sockaddrThe socket address.
Returns
The expected connection info or error.

◆ IP()

constexpr const std::string & StormByte::Network::Connection::Info::IP ( ) const
inlineconstexprnoexcept

The function to get the IP address.

Returns
The IP address.

◆ operator=() [1/2]

Info & StormByte::Network::Connection::Info::operator= ( const Info other)
deletenoexcept

The assignment operator of the Info class.

Parameters
otherThe other Info to assign.
Returns
The reference to the assigned Info.

◆ operator=() [2/2]

Info & StormByte::Network::Connection::Info::operator= ( Info &&  other)
defaultnoexcept

The move assignment operator of the Info class.

Parameters
otherThe other Info to assign.
Returns
The reference to the assigned Info.

◆ Port()

constexpr const unsigned short & StormByte::Network::Connection::Info::Port ( ) const
inlineconstexprnoexcept

The function to get the port.

Returns
The port.

◆ SockAddr()

std::shared_ptr< const sockaddr > StormByte::Network::Connection::Info::SockAddr ( ) const
inlinenoexcept

The function to get the socket address.

Returns
The socket address.

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