Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
XSocketAddress Class Reference

Socket bad address exception. More...

#include <XSocket.h>

Inheritance diagram for XSocketAddress:
Collaboration diagram for XSocketAddress:

Public Types

enum class  SocketError {
  Unknown , NotFound , NoAddress , Unsupported ,
  BadPort
}
 Failure codes. More...

Public Member Functions

 XSocketAddress (SocketError, const std::string &hostname, int port) noexcept
 ~XSocketAddress () override throw () =default
Public Member Functions inherited from XBase
 XBase ()
 Use getWhat() as the result of what()
 XBase (const std::string &msg)
 Use msg as the result of what()
 ~XBase () override throw () =default
const char * what () const override throw ()
 Reason for exception.

accessors

SocketError getError () const noexcept
 Get the error code.
std::string getHostname () const noexcept
 Get the hostname.
int getPort () const noexcept
 Get the port.
std::string getWhat () const override throw ()
 Get a human readable string describing the exception.

Additional Inherited Members

Protected Member Functions inherited from XBase
virtual std::string format (const char *id, const char *defaultFormat,...) const noexcept
 Format a string.

Detailed Description

Socket bad address exception.

Thrown when attempting to create an invalid network address.

Member Enumeration Documentation

◆ SocketError

enum class XSocketAddress::SocketError
strong

Failure codes.

Enumerator
Unknown 

Unknown error.

NotFound 

The hostname is unknown.

NoAddress 

The hostname is valid but has no IP address.

Unsupported 

The hostname is valid but has no supported address.

BadPort 

The port is invalid.

Constructor & Destructor Documentation

◆ XSocketAddress()

XSocketAddress::XSocketAddress ( SocketError error,
const std::string & hostname,
int port )
noexcept

◆ ~XSocketAddress()

XSocketAddress::~XSocketAddress ( )
throw ( )
overridedefault

Member Function Documentation

◆ getError()

XSocketAddress::SocketError XSocketAddress::getError ( ) const
noexcept

Get the error code.

◆ getHostname()

std::string XSocketAddress::getHostname ( ) const
noexcept

Get the hostname.

◆ getPort()

int XSocketAddress::getPort ( ) const
noexcept

Get the port.

◆ getWhat()

std::string XSocketAddress::getWhat ( ) const
throw ( )
overrideprotectedvirtual

Get a human readable string describing the exception.

Reimplemented from XBase.


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