simple-socket library 1.9.0
Loading...
Searching...
No Matches
NET::SocketException Class Reference

Signals a problem with the execution of a socket call. More...

#include <simple_socket/SimpleSocket.h>

Inheritance diagram for NET::SocketException:
Collaboration diagram for NET::SocketException:

Public Member Functions

 SocketException (std::string_view message, bool inclErrno=true)
 SocketException (std::string_view message, int error)
 SocketException (const SocketException &)=default
 ~SocketException () noexcept
 Provided just to guarantee that no exceptions are thrown.
const char * what () const noexcept
 Returns a C-string describing the cause of the current error.
int errorCode () const noexcept
 Returns the glibc errno code of the current error.

Detailed Description

Signals a problem with the execution of a socket call.

Examples
TCP_Client.cpp, TCP_Client_Reconnect.cpp, TCP_Server.cpp, UDP_Commands.cpp, UDP_Multicast.cpp, and mini_ifconfig.cpp.

Definition at line 11 of file SimpleSocket.h.

Constructor & Destructor Documentation

◆ SocketException() [1/3]

NET::SocketException::SocketException ( std::string_view message,
bool inclErrno = true )

Construct a SocketException with a explanatory message.

Parameters
messageexplanatory message
inclErrnoif true system message from strerror(errno) is postfixed

◆ SocketException() [2/3]

NET::SocketException::SocketException ( std::string_view message,
int error )

Construct a SocketException with a explanatory message.

Parameters
messageexplanatory message
errorsystem message from strerror(error) is postfixed

◆ SocketException() [3/3]

NET::SocketException::SocketException ( const SocketException & )
default

◆ ~SocketException()

NET::SocketException::~SocketException ( )
inlinenoexcept

Provided just to guarantee that no exceptions are thrown.

Definition at line 31 of file SimpleSocket.h.

Member Function Documentation

◆ errorCode()

int NET::SocketException::errorCode ( ) const
inlinenoexcept

Returns the glibc errno code of the current error.

Examples
mini_ifconfig.cpp.

Definition at line 37 of file SimpleSocket.h.

◆ what()

const char * NET::SocketException::what ( ) const
inlinenoexcept

Returns a C-string describing the cause of the current error.

Examples
TCP_Client.cpp, TCP_Client_Reconnect.cpp, TCP_Server.cpp, UDP_Commands.cpp, UDP_Multicast.cpp, and mini_ifconfig.cpp.

Definition at line 34 of file SimpleSocket.h.


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