|
| | UdpServer (const int &port, const bool &flag1=false, const int &sec=-1, const bool &flag2=true) |
| | 构造函数 更多...
|
| |
| bool | createFD (const int &port, const bool &flag1=false, const int &sec=-1, const bool &flag2=true) |
| | 销毁原来的套接字,重新创建一个服务端 更多...
|
| |
| | ~UdpServer () |
| | 析构函数,对象生命结束会会关闭套接字 更多...
|
| |
Public 成员函数 继承自 stt::network::UdpFDHandler |
| void | setFD (const int &fd, const bool &flag1=false, const int &sec=-1, const bool &flag2=false) |
| | 设置fd 更多...
|
| |
| void | blockSet (const int &sec=-1) |
| | 设置为阻塞模式 更多...
|
| |
| void | unblockSet () |
| | 设置为非阻塞模式 更多...
|
| |
| bool | multiUseSet () |
| | 设置SO_REUSEADDR模式 更多...
|
| |
| int | getFD () |
| | 返回fd 更多...
|
| |
| void | close (const bool &cle=true) |
| | 置空对象,关闭套接字 更多...
|
| |
| int | sendData (const std::string &data, const std::string &ip, const int &port, const bool &block=true) |
| | 向目标发送字符串数据。 更多...
|
| |
| int | sendData (const char *data, const uint64_t &length, const std::string &ip, const int &port, const bool &block=true) |
| | 向目标发送指定长度的二进制数据。 更多...
|
| |
| int | recvData (std::string &data, const uint64_t &length, std::string &ip, int &port) |
| | 接收一次数据到string字符串容器 更多...
|
| |
| int | recvData (char *data, const uint64_t &length, std::string &ip, int &port) |
| | 接收一次数据到char*容器 更多...
|
| |