Class for portable handling of network socket errors. More...
#include <socket.hpp>
Public Member Functions | |
CSocketErr (const CSocketErr &)=delete | |
CSocketErr & | operator= (const CSocketErr &)=delete |
operator const int & () | |
Get error number. | |
void | catch_error () |
Catch error for later use. | |
std::string | error_str () const |
Get human readable error description of the catched error. | |
Class for portable handling of network socket errors.
There is a compatibility problem with Winsock2 on the Microsoft Windows platform that does not support detailed error information given in the global variable 'errno' that is used by POSIX. Instead it returns them with calling 'WSAGetLastError()'. This class encapsulates differences so there is no need to always check the platform to get the error information.
This class is optimized for frequent short-term use. It's a simple class without inheritence and virtual methods.
Definition at line 537 of file socket.hpp.
UPnPsdk::CSocketErr::operator const int & | ( | ) |
Get error number.
Definition at line 602 of file socket.cpp.
void UPnPsdk::CSocketErr::catch_error | ( | ) |
Catch error for later use.
Definition at line 609 of file socket.cpp.
std::string UPnPsdk::CSocketErr::error_str | ( | ) | const |
Get human readable error description of the catched error.
Definition at line 618 of file socket.cpp.