SEDNL  .
Simple Event Driven Network Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Friends | List of all members
SedNL::SocketAddress Class Reference

Contains an inet address (ip(v4 or v6) and port). More...

#include <SocketAddress.hpp>

Public Member Functions

 SocketAddress ()
 Construct an empty SocketAddress.
 
 SocketAddress (int port)
 Construct a SocketAddress containing only a port number. More...
 
 SocketAddress (int port, std::string server_name)
 Construct a SocketAddress containing port and server name. More...
 
bool is_client_valid () const noexcept
 Tell if it's a valid TCPClient SocketAddress. More...
 
bool is_server_valid () const noexcept
 Tell if it's a valid TCPServer SocketAddress. More...
 

Friends

class TCPClient
 
class TCPServer
 

Detailed Description

Contains an inet address (ip(v4 or v6) and port).

For use cases, see TCPClient and TCPServer.

Definition at line 35 of file SocketAddress.hpp.

Constructor & Destructor Documentation

SedNL::SocketAddress::SocketAddress ( int  port)

Construct a SocketAddress containing only a port number.

Save the port number and store and empty server_name.

Parameters
[in]portPort number.
SedNL::SocketAddress::SocketAddress ( int  port,
std::string  server_name 
)

Construct a SocketAddress containing port and server name.

Parameters
[in]portPort number.
[in]server_nameIP or host name. Examples : google.fr, 127.0.0.1, localhost, etc.

Member Function Documentation

bool SedNL::SocketAddress::is_client_valid ( ) const
noexcept

Tell if it's a valid TCPClient SocketAddress.

Returns
True if it's a valid address for TCPClient, False otherwise.
bool SedNL::SocketAddress::is_server_valid ( ) const
noexcept

Tell if it's a valid TCPServer SocketAddress.

Returns
True if it's a valid address for TCPServer, False otherwise.

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