NetLink Sockets C++  1.0.0
Networking C++ Library
 All Classes Namespaces Files Functions Enumerations Enumerator Pages
Public Types | Public Member Functions | List of all members
NL::Exception Class Reference

#include <netlink/exception.h>

Public Types

enum  CODE {
  BAD_PROTOCOL, BAD_IP_VER, ERROR_INIT, ERROR_SET_ADDR_INFO,
  ERROR_GET_ADDR_INFO, ERROR_SET_SOCK_OPT, ERROR_CAN_NOT_LISTEN, ERROR_CONNECT_SOCKET,
  ERROR_SEND, ERROR_READ, ERROR_IOCTL, ERROR_SELECT,
  ERROR_ALLOC, EXPECTED_TCP_SOCKET, EXPECTED_UDP_SOCKET, EXPECTED_CLIENT_SOCKET,
  EXPECTED_SERVER_SOCKET, EXPECTED_HOST_TO, OUT_OF_RANGE
}
 

Public Member Functions

 Exception (CODE code, const string &msg, int nativeErrorCode=0)
 
CODE code () const
 
const string & msg () const
 
const char * what () const
 
int nativeErrorCode () const
 

Detailed Description

Exception Class

Examples:
chatClient.cc, clientEcho.cc, serverEcho.cc, udpDirectChat.cc, and webGet.cc.

Member Function Documentation

CODE NL::Exception::code ( ) const
inline

Returns the error code:

Returns
Error code
Note
Defined Error Codes:
  • BAD_PROTOCOL
  • BAD_IP_VER
  • ERROR_INIT
  • ERROR_SET_ADDR_INFO
  • ERROR_GET_ADDR_INFO
  • ERROR_SET_SOCK_OPT
  • ERROR_CAN_NOT_LISTEN
  • ERROR_CONNECT_SOCKET
  • ERROR_SEND
  • ERROR_READ
  • ERROR_IOCTL
  • ERROR_SELECT
  • ERROR_ALLOC
  • EXPECTED_TCP_SOCKET
  • EXPECTED_UDP_SOCKET
  • EXPECTED_CLIENT_SOCKET
  • EXPECTED_SERVER_SOCKET
  • EXPECTED_HOST_TO
  • OUT_OF_RANGE
const string& NL::Exception::msg ( ) const
inline

Returns the error text message

Returns
A string with a human readable error description
int NL::Exception::nativeErrorCode ( ) const
inline

Returns the native error code received.

Returns
Native error code set by OS
Warning
Native error codes differ depending of the OS
const char* NL::Exception::what ( ) const
inline

Returns the error text message

Returns
A C-string with a human readable error description
Examples:
chatClient.cc, clientEcho.cc, serverEcho.cc, udpDirectChat.cc, and webGet.cc.

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