DDS
ver. 3.6
|
INet declares helpers for Socket and Network operations. More...
Classes | |
struct | _socket2string |
A template class, which makes a string representation of the socket. More... | |
class | CSocketClient |
CSocketClient implements a simple socket client. More... | |
class | CSocketServer |
CSocketServer implements a simple socket server. More... | |
class | smart_socket |
A wrapper for a basic Socket. More... | |
struct | SSocket2String_Trait |
A Trait class for _socket2string template. This class operates on a local side of the socket. More... | |
struct | SSocketPeer2String_Trait |
A Trait class for _socket2string template. This class operates a peer of the socket. More... | |
Typedefs | |
typedef int | Socket_t |
A basic socket type. More... | |
typedef _socket2string< SSocket2String_Trait > | socket2string |
Socket to string representation. More... | |
typedef _socket2string< SSocketPeer2String_Trait > | peer2string |
Socket-peer to string representation. More... | |
Functions | |
std::string | socket_error_string (Socket_t _socket, const char *_strMsg) |
The function returns socket's error string. More... | |
size_t | read_from_socket (smart_socket &_Socket, BYTEVector_t *_Buf) |
template<typename _T > | |
smart_socket & | operator>> (smart_socket &_Socket, _T *_Buf) |
This is a stream operator which helps to receive data from the given socket. More... | |
template<> | |
smart_socket & | operator>> (smart_socket &_Socket, BYTEVector_t *_Buf) |
This is a stream operator which helps to receive data from the given socket. More... | |
int | sendall (int s, const unsigned char *const buf, int len, int flags) |
A helper function, which insures that whole buffer was send. More... | |
template<typename _T > | |
smart_socket & | operator<< (smart_socket &_Socket, _T &_Buf) |
This is a stream operator which helps to send data to the given socket. More... | |
template<> | |
smart_socket & | operator<< (smart_socket &_Socket, BYTEVector_t &_Buf) |
This is a stream operator which helps to send data to the given socket. More... | |
void | send_string (smart_socket &_Socket, const std::string &_Str2Send) |
A helper function, which sends a string to the given socket. More... | |
void | receive_string (smart_socket &_Socket, std::string *_Str2Receive, size_t _BufSize) |
A helper function, which receives a string from the given socket. More... | |
bool | is_ip_address (std::string _Addr) |
This function checks whether _Addr is an IP address or not. More... | |
void | host2ip (const std::string &_Host, std::string *_IP) |
host2ip converts a given host name to IP address. More... | |
void | ip2host (const std::string &_IP, std::string *_Host) |
ip2host converts a given IP address to host name. More... | |
int | get_free_port (int _Min, int _Max) |
The function checks and returns a free port from the given range of the ports. More... | |
int | get_free_port (int _Port) |
The function checks whether the given port is free or not. More... | |
uint64_t | htonll (uint64_t val) |
uint64_t | ntohll (uint64_t val) |
template<typename T > | |
T | normalizeRead (T _value) |
template<> | |
uint16_t | normalizeRead< uint16_t > (uint16_t _value) |
template<> | |
uint32_t | normalizeRead< uint32_t > (uint32_t _value) |
template<> | |
uint64_t | normalizeRead< uint64_t > (uint64_t _value) |
template<typename T > | |
T | normalizeWrite (T _value) |
template<> | |
uint16_t | normalizeWrite< uint16_t > (uint16_t _value) |
template<> | |
uint32_t | normalizeWrite< uint32_t > (uint32_t _value) |
template<> | |
uint64_t | normalizeWrite< uint64_t > (uint64_t _value) |
void | writeall (int _handle, const std::string &_msg) |
A helper function, which insures that whole buffer was written. More... | |
INet declares helpers for Socket and Network operations.
Socket-peer to string representation.
Socket to string representation.
typedef int dds::misc::INet::Socket_t |
A basic socket type.
|
inline |
The function checks and returns a free port from the given range of the ports.
|
inline |
The function checks whether the given port is free or not.
|
inline |
host2ip converts a given host name to IP address.
|
inline |
|
inline |
ip2host converts a given IP address to host name.
|
inline |
This function checks whether _Addr is an IP address or not.
T dds::misc::INet::normalizeRead | ( | T | _value | ) |
|
inline |
|
inline |
|
inline |
T dds::misc::INet::normalizeWrite | ( | T | _value | ) |
|
inline |
|
inline |
|
inline |
|
inline |
smart_socket& dds::misc::INet::operator<< | ( | smart_socket & | _Socket, |
_T & | _Buf | ||
) |
This is a stream operator which helps to send data to the given socket.
Generic declaration (no implementation).
|
inline |
This is a stream operator which helps to send data to the given socket.
A template specialization for BYTEVector_t type.
smart_socket& dds::misc::INet::operator>> | ( | smart_socket & | _Socket, |
_T * | _Buf | ||
) |
This is a stream operator which helps to receive data from the given socket.
Generic declaration (no implementation).
|
inline |
This is a stream operator which helps to receive data from the given socket.
A template specialization for BYTEVector_t type.
|
inline |
|
inline |
A helper function, which receives a string from the given socket.
|
inline |
A helper function, which sends a string to the given socket.
|
inline |
A helper function, which insures that whole buffer was send.
|
inline |
The function returns socket's error string.
|
inline |
A helper function, which insures that whole buffer was written.