Base Framework
Public Member Functions | Static Public Member Functions | List of all members
InetEndPoint Class Reference

Internet end point. More...

#include <base/net/InetEndPoint.h>

Inherits Object.

Public Member Functions

 InetEndPoint () noexcept
 
 InetEndPoint (const InetAddress &address, unsigned short port) noexcept
 
 InetEndPoint (const InetAddress &address, const InetService &service) noexcept
 
 InetEndPoint (const InetAddress &address, const String &service)
 
 InetEndPoint (const String &host, unsigned short port)
 
 InetEndPoint (const String &host, const String &service)
 
 InetEndPoint (const InetEndPoint &copy) noexcept
 
InetEndPointoperator= (const InetEndPoint &assign) noexcept
 
bool operator== (const InetEndPoint &compare) const noexcept
 
bool operator!= (const InetEndPoint &compare) const noexcept
 
const InetAddressgetAddress () const noexcept
 
unsigned short getPort () const noexcept
 
InetService getService () const noexcept
 
void setAddress (const InetAddress &value) noexcept
 
void setPort (unsigned short value) noexcept
 

Static Public Member Functions

static unsigned short getPort (const String &service)
 
static InetEndPoint getEndPoint (const String &endpoint)
 

Detailed Description

Internet end point.

Internet end point (i.e. both internet address and port number).

Version
1.0
Examples
testsuite/client.cpp, testsuite/echod.cpp, testsuite/ftp.cpp, testsuite/http.cpp, and testsuite/ping.cpp.

Constructor & Destructor Documentation

◆ InetEndPoint() [1/7]

InetEndPoint::InetEndPoint ( )
noexcept

Initializes default end point.

◆ InetEndPoint() [2/7]

InetEndPoint::InetEndPoint ( const InetAddress address,
unsigned short  port 
)
noexcept

Initializes the end point from the specified address and port.

Parameters
addressThe address.
portThe port.

◆ InetEndPoint() [3/7]

InetEndPoint::InetEndPoint ( const InetAddress address,
const InetService service 
)
noexcept

Initializes the end point from the specified address and service.

Parameters
addressThe address.
serviceThe service.

◆ InetEndPoint() [4/7]

InetEndPoint::InetEndPoint ( const InetAddress address,
const String service 
)

Initializes the end point from the specified address and service.

Parameters
addressThe address.
serviceThe service (e.g. 'http' or '80').

◆ InetEndPoint() [5/7]

InetEndPoint::InetEndPoint ( const String host,
unsigned short  port 
)

Initializes end point from string representations of host and service.

Parameters
hostThe host (e.g. '127.0.0.1' or 'www.google.com').
portThe port.

◆ InetEndPoint() [6/7]

InetEndPoint::InetEndPoint ( const String host,
const String service 
)

Initializes end point from string representations of host and service.

Parameters
hostThe host (e.g. '127.0.0.1' or 'www.google.com').
serviceThe service (e.g. 'http' or '80').

◆ InetEndPoint() [7/7]

InetEndPoint::InetEndPoint ( const InetEndPoint copy)
noexcept

Initialize object from other object.

Member Function Documentation

◆ getAddress()

const InetAddress& InetEndPoint::getAddress ( ) const
inlinenoexcept

◆ getEndPoint()

static InetEndPoint InetEndPoint::getEndPoint ( const String endpoint)
static

Returns the end point for the given string.

◆ getPort() [1/2]

unsigned short InetEndPoint::getPort ( ) const
inlinenoexcept

Returns the port.

◆ getPort() [2/2]

static unsigned short InetEndPoint::getPort ( const String service)
static

Returns the port for the given service.

Examples
testsuite/client.cpp, testsuite/ftp.cpp, testsuite/http.cpp, and testsuite/ping.cpp.

◆ getService()

InetService InetEndPoint::getService ( ) const
noexcept

Returns the port converted to service.

◆ operator!=()

bool InetEndPoint::operator!= ( const InetEndPoint compare) const
inlinenoexcept

Returns true if the end point are non-equal.

◆ operator=()

InetEndPoint& InetEndPoint::operator= ( const InetEndPoint assign)
noexcept

Default assignment.

◆ operator==()

bool InetEndPoint::operator== ( const InetEndPoint compare) const
inlinenoexcept

Returns true if the end point are equal.

◆ setAddress()

void InetEndPoint::setAddress ( const InetAddress value)
noexcept

Sets the address.

◆ setPort()

void InetEndPoint::setPort ( unsigned short  value)
noexcept

Sets the port.