Network Namespace Reference

Network namespace represent all networks connection. More...

## Classes

class | Exception
| This class is the top exception class used in libsocket. More...
class | LocalSocket
| This class represent a local connection (client and server) More...
class | NetSocket
| This class represent an abstract socket connection (udp | tcp server | tcp client) More...
class | Socket
| This class represent an abstract socket connection (udp | tcp server | tcp client) More...
class | TcpSocket
| This class represent a tcp connection (client and server) More...
class | UdpSocket
| This class represent a udp connection (client and server) More...

## Typedefs

typedef enum Network::e_gnutls_kind | GnuTLSKind
typedef enum Network::e_pkind | PROTO_KIND
typedef enum Network::e_kind | SOCKET_KIND
typedef enum Network::e_version | SOCKET_VERSION

## Enumerations

enum | e_gnutls_kind { LIBSOCKET_TLS, LIBSOCKET_SSL }
enum | e_pkind { text, binary }
enum | e_kind { TCP, UDP, LOCAL }
enum | e_version { V4, V6 }

## Functions

Socket & | operator<< (Socket &s, const std::string &str)
| write a string on current socket More...
Socket & | operator>> (Socket &s, std::string &str)
| read a string on current socket More...
std::ostream & | operator<< (std::ostream &stream, Exception &e)
| NEW_EXCEPTION (HostnameError)
| exception launched when a hostname is incorrect More...
| NEW_EXCEPTION (Ipv6SupportError)
| exception launched when user want ipv6, but lib is not compiled with More...
| NEW_EXCEPTION (TLSError)
| exception launched when error is received during TLS initialization More...
| NEW_EXCEPTION (InvalidFile)
| exception launched when a file does not exist More...
| NEW_EXCEPTION (TLSSupportError)
| exception launched when user want TLS, but lib is not compiled with More...
| NEW_EXCEPTION (InetptonError)
| exception launched when a addr is invalid pour inet_pton More...
| NEW_EXCEPTION (InetntopError)
| exception launched when the addr is not valid for inet_ntop More...
| NEW_EXCEPTION (ConnectionClosed)
| exception launched when connection is closed More...
| NEW_EXCEPTION (NoConnection)
| exception launched when there is no active connection More...
| NEW_EXCEPTION (Timeout)
| exception launched when there is a timeout More...
| NEW_EXCEPTION (BindError)
| exception launched when bind libc function return an error More...
| NEW_EXCEPTION (SocketError)
| exception launched when socket libc function return an error More...
| NEW_EXCEPTION (ListenError)
| exception launched when listen libc function return an error More...
| NEW_EXCEPTION (SetsockoptError)
| exception launched when setsockopt libc function return an error More...
| NEW_EXCEPTION (CloseError)
| exception launched when close libc function return an error More...
| NEW_EXCEPTION (SelectError)
| exception launched when select libc function return an error More...
| NEW_EXCEPTION (ConnectError)
| exception launched when connect libc function return an error More...
| NEW_EXCEPTION (AcceptError)
| exception launched when accept libc function return an error More...
| NEW_EXCEPTION (GetpeernameError)
| exception launched when getpeername libc function return an error More...
| NEW_EXCEPTION (WSAStartupError)
| exception launched when WSAStartup windows function return an error More...

## Detailed Description

Network namespace represent all networks connection.

## Typedef Documentation

## GnuTLSKind

typedef enum Network::e_gnutls_kind Network::GnuTLSKind

## PROTO_KIND

typedef enum Network::e_pkind Network::PROTO_KIND

## SOCKET_KIND

typedef enum Network::e_kind Network::SOCKET_KIND

## SOCKET_VERSION

typedef enum Network::e_version Network::SOCKET_VERSION

## Enumeration Type Documentation

## e_gnutls_kind

enum Network::e_gnutls_kind

Enumerator
LIBSOCKET_TLS |
LIBSOCKET_SSL |

Definition at line 66 of file socket.hh.

{
LIBSOCKET_TLS,
LIBSOCKET_SSL
} GnuTLSKind;

## e_kind

enum Network::e_kind

Enumerator
TCP |
UDP |
LOCAL |

Definition at line 78 of file socket.hh.

{
TCP,
UDP,
LOCAL
} SOCKET_KIND;

## e_pkind

enum Network::e_pkind

Enumerator
text |
binary |

Definition at line 72 of file socket.hh.

{
text,
binary
} PROTO_KIND;

## e_version

enum Network::e_version

Enumerator
V4 |
V6 |

Definition at line 85 of file socket.hh.

{
V4,
V6
} SOCKET_VERSION;

## Function Documentation

## NEW_EXCEPTION() [1/20]

Network::NEW_EXCEPTION | ( | AcceptError |  | ) |

exception launched when accept libc function return an error

## NEW_EXCEPTION() [2/20]

Network::NEW_EXCEPTION | ( | BindError |  | ) |

exception launched when bind libc function return an error

## NEW_EXCEPTION() [3/20]

Network::NEW_EXCEPTION | ( | CloseError |  | ) |

exception launched when close libc function return an error

## NEW_EXCEPTION() [4/20]

Network::NEW_EXCEPTION | ( | ConnectError |  | ) |

exception launched when connect libc function return an error

## NEW_EXCEPTION() [5/20]

Network::NEW_EXCEPTION | ( | ConnectionClosed |  | ) |

exception launched when connection is closed

## NEW_EXCEPTION() [6/20]

Network::NEW_EXCEPTION | ( | GetpeernameError |  | ) |

exception launched when getpeername libc function return an error

## NEW_EXCEPTION() [7/20]

Network::NEW_EXCEPTION | ( | HostnameError |  | ) |

exception launched when a hostname is incorrect

## NEW_EXCEPTION() [8/20]

Network::NEW_EXCEPTION | ( | InetntopError |  | ) |

exception launched when the addr is not valid for inet_ntop

## NEW_EXCEPTION() [9/20]

Network::NEW_EXCEPTION | ( | InetptonError |  | ) |

exception launched when a addr is invalid pour inet_pton

## NEW_EXCEPTION() [10/20]

Network::NEW_EXCEPTION | ( | InvalidFile |  | ) |

exception launched when a file does not exist

## NEW_EXCEPTION() [11/20]

Network::NEW_EXCEPTION | ( | Ipv6SupportError |  | ) |

exception launched when user want ipv6, but lib is not compiled with

## NEW_EXCEPTION() [12/20]

Network::NEW_EXCEPTION | ( | ListenError |  | ) |

exception launched when listen libc function return an error

## NEW_EXCEPTION() [13/20]

Network::NEW_EXCEPTION | ( | NoConnection |  | ) |

exception launched when there is no active connection

## NEW_EXCEPTION() [14/20]

Network::NEW_EXCEPTION | ( | SelectError |  | ) |

exception launched when select libc function return an error

## NEW_EXCEPTION() [15/20]

Network::NEW_EXCEPTION | ( | SetsockoptError |  | ) |

exception launched when setsockopt libc function return an error

## NEW_EXCEPTION() [16/20]

Network::NEW_EXCEPTION | ( | SocketError |  | ) |

exception launched when socket libc function return an error

## NEW_EXCEPTION() [17/20]

Network::NEW_EXCEPTION | ( | Timeout |  | ) |

exception launched when there is a timeout

## NEW_EXCEPTION() [18/20]

Network::NEW_EXCEPTION | ( | TLSError |  | ) |

exception launched when error is received during TLS initialization

## NEW_EXCEPTION() [19/20]

Network::NEW_EXCEPTION | ( | TLSSupportError |  | ) |

exception launched when user want TLS, but lib is not compiled with

## NEW_EXCEPTION() [20/20]

Network::NEW_EXCEPTION | ( | WSAStartupError |  | ) |

exception launched when WSAStartup windows function return an error

## operator<<() [1/2]

Socket & Network::operator<< | ( | Socket & | s,
|  | const std::string & | str
| ) |  |

write a string on current socket

Definition at line 367 of file socket.cc.

{
s.write(str);
return s;
}

References Network::Socket::write().

## operator<<() [2/2]

std::ostream & Network::operator<< | ( | std::ostream & | stream,
|  | Exception & | e
| ) |  |

Definition at line 27 of file socketexception.cc.

{
e.print(stream);
return (stream);
}

References Network::Exception::print().

## operator>>()

Socket & Network::operator>> | ( | Socket & | s,
|  | std::string & | str
| ) |  |

read a string on current socket

Definition at line 373 of file socket.cc.

{
str = s.read();
return s;
}

References Network::Socket::read().

Network::LOCAL
@ LOCAL
Definition: socket.hh:82
Network::GnuTLSKind
enum Network::e_gnutls_kind GnuTLSKind
Network::V6
@ V6
Definition: socket.hh:88
Network::binary
@ binary
Definition: socket.hh:75
Network::PROTO_KIND
enum Network::e_pkind PROTO_KIND
Network::V4
@ V4
Definition: socket.hh:87
Network::SOCKET_VERSION
enum Network::e_version SOCKET_VERSION
Network::text
@ text
Definition: socket.hh:74
Network::TCP
@ TCP
Definition: socket.hh:80
Network::LIBSOCKET_SSL
@ LIBSOCKET_SSL
Definition: socket.hh:69
Network::UDP
@ UDP
Definition: socket.hh:81
Network::LIBSOCKET_TLS
@ LIBSOCKET_TLS
Definition: socket.hh:68
Network::SOCKET_KIND
enum Network::e_kind SOCKET_KIND