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 | Protected Attributes | List of all members
StormByte::Network::EndPoint Class Reference

Represents a network endpoint, serving as a base class for both clients and servers. More...

#include <endpoint.hxx>

Inheritance diagram for StormByte::Network::EndPoint:
Inheritance graph
[legend]

Public Member Functions

 EndPoint (const Connection::Protocol &protocol, std::shared_ptr< Connection::Handler > handler, std::shared_ptr< Logger > logger) noexcept
 Constructs an EndPoint with the specified protocol, handler, and logger.
 
 EndPoint (const EndPoint &other)=delete
 Deleted copy constructor to prevent copying.
 
 EndPoint (EndPoint &&other) noexcept=default
 Defaulted move constructor.
 
virtual ~EndPoint () noexcept
 Virtual destructor for proper cleanup in derived classes.
 
EndPointoperator= (const EndPoint &other)=delete
 Deleted copy assignment operator to prevent copying.
 
EndPointoperator= (EndPoint &&other) noexcept=default
 Defaulted move assignment operator.
 
const Connection::Protocol & Protocol () const noexcept
 Retrieves the protocol used by the endpoint.
 

Protected Attributes

Connection::Protocol m_protocol
 The protocol used by the endpoint (e.g., IPv4, IPv6).
 
std::shared_ptr< Connection::Handlerm_handler
 Shared pointer to the connection handler.
 
std::shared_ptr< Logger > m_logger
 Shared pointer to the logger instance.
 
std::atomic< Connection::Status > m_status
 The current connection status of the endpoint.
 
Socket::Socket * m_socket
 Unique pointer to the socket instance.
 

Detailed Description

Represents a network endpoint, serving as a base class for both clients and servers.

Constructor & Destructor Documentation

◆ EndPoint()

StormByte::Network::EndPoint::EndPoint ( const Connection::Protocol &  protocol,
std::shared_ptr< Connection::Handler handler,
std::shared_ptr< Logger >  logger 
)
noexcept

Constructs an EndPoint with the specified protocol, handler, and logger.

Parameters
protocolThe protocol to use (e.g., IPv4, IPv6).
handlerA shared pointer to the connection handler.
loggerA shared pointer to the logger instance.

Member Function Documentation

◆ Protocol()

const Connection::Protocol & StormByte::Network::EndPoint::Protocol ( ) const
noexcept

Retrieves the protocol used by the endpoint.

Returns
A constant reference to the protocol.

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