Udp server operation class.
More...
#include <sttnet_English.h>
|
| | UdpServer (const int &port, const bool &flag1=false, const int &sec=-1, const bool &flag2=true) |
| | Constructor. More...
|
| |
| bool | createFD (const int &port, const bool &flag1=false, const int &sec=-1, const bool &flag2=true) |
| | Destroy the original socket and recreate a server. More...
|
| |
| | ~UdpServer () |
| | Destructor, closes the socket when the object's life ends. More...
|
| |
Public Member Functions inherited from stt::network::UdpFDHandler |
| void | setFD (const int &fd, const bool &flag1=false, const int &sec=-1, const bool &flag2=false) |
| | Set fd. More...
|
| |
| void | blockSet (const int &sec=-1) |
| | Set to blocking mode. More...
|
| |
| void | unblockSet () |
| | Set to non-blocking mode. More...
|
| |
| bool | multiUseSet () |
| | Set SO_REUSEADDR mode. More...
|
| |
| int | getFD () |
| | Return fd. More...
|
| |
| void | close (const bool &cle=true) |
| | Empty the object and close the socket. More...
|
| |
| int | sendData (const std::string &data, const std::string &ip, const int &port, const bool &block=true) |
| | Send string data to the target. More...
|
| |
| int | sendData (const char *data, const uint64_t &length, const std::string &ip, const int &port, const bool &block=true) |
| | Send a specified length of binary data to the target. More...
|
| |
| int | recvData (std::string &data, const uint64_t &length, std::string &ip, int &port) |
| | Receive data once into a string container. More...
|
| |
| int | recvData (char *data, const uint64_t &length, std::string &ip, int &port) |
| | Receive data once into a char* container. More...
|
| |
Udp server operation class.
| stt::network::UdpServer::UdpServer |
( |
const int & |
port, |
|
|
const bool & |
flag1 = false, |
|
|
const int & |
sec = -1, |
|
|
const bool & |
flag2 = true |
|
) |
| |
Constructor.
- Parameters
-
| port | Port number |
| flag1 | true: Set to non-blocking mode, false: Set to blocking mode (default is blocking mode) |
| sec | Set blocking timeout (seconds) (default is -1, i.e., infinite wait) |
| flag2 | true: Set SO_REUSEADDR mode, false: Do not set SO_REUSEADDR mode |
| stt::network::UdpServer::~UdpServer |
( |
| ) |
|
|
inline |
Destructor, closes the socket when the object's life ends.
| bool stt::network::UdpServer::createFD |
( |
const int & |
port, |
|
|
const bool & |
flag1 = false, |
|
|
const int & |
sec = -1, |
|
|
const bool & |
flag2 = true |
|
) |
| |
Destroy the original socket and recreate a server.
- Parameters
-
| flag1 | true: Set to non-blocking mode, false: Set to blocking mode (default is blocking mode) |
| sec | Set blocking timeout (seconds) (default is -1, i.e., infinite wait) |
| flag2 | true: Set SO_REUSEADDR mode, false: Do not set SO_REUSEADDR mode |
The documentation for this class was generated from the following file: