|
| | TcpClient (const bool &TLS=false, const char *ca="", const char *cert="", const char *key="", const char *passwd="") |
| | TcpClient类的构造函数 更多...
|
| |
| bool | connect (const std::string &ip, const int &port) |
| | 向服务端发起tcp连接 更多...
|
| |
| void | resetCTX (const bool &TLS=false, const char *ca="", const char *cert="", const char *key="", const char *passwd="") |
| | 重新或第一次设置TLS加密参数 更多...
|
| |
| bool | close () |
| | 如果对象有套接字连接,关闭和释放这个连接和套接字,并且重新新建一个套接字。 更多...
|
| |
| | ~TcpClient () |
| | TcpClient的析构函数,会关闭释放套接字和其连接 更多...
|
| |
| std::string | getServerIP () |
| | 返回已连接的服务端的ip return 已连接的服务端的ip 更多...
|
| |
| int | getServerPort () |
| | 返回已连接的客户端的端口 return 已连接的服务端的端口 更多...
|
| |
| bool | isConnect () |
| | 返回对象的连接状态 更多...
|
| |
Public 成员函数 继承自 stt::network::TcpFDHandler |
| void | setFD (const int &fd, SSL *ssl, const bool &flag1=false, const bool &flag2=false, const int &sec=-1) |
| | 传入套接字初始化对象 更多...
|
| |
| int | getFD () |
| | 获取该对象的套接字 更多...
|
| |
| SSL * | getSSL () |
| | 获取该对象的加密SSL句柄 更多...
|
| |
| void | close (const bool &cle=true) |
| | 关闭对象 更多...
|
| |
| void | blockSet (const int &sec=-1) |
| | 设置对象中的套接字为阻塞模式 更多...
|
| |
| void | unblockSet () |
| | 设置对象中的套接字为非阻塞模式 更多...
|
| |
| bool | multiUseSet () |
| | 设置对象中的套接字为SO_REUSEADDR模式 更多...
|
| |
| bool | isConnect () |
| | 判断对象是否有套接字绑定 更多...
|
| |
| int | sendData (const std::string &data, const bool &block=true) |
| | 向已连接的套接字发送字符串数据。 更多...
|
| |
| int | sendData (const char *data, const uint64_t &length, const bool &block=true) |
| | 向已连接的套接字发送指定长度的二进制数据。 更多...
|
| |
| int | recvDataByLength (std::string &data, const uint64_t &length, const int &sec=2) |
| | 从已连接的套接字中阻塞接收指定长度的数据到字符串 更多...
|
| |
| int | recvDataByLength (char *data, const uint64_t &length, const int &sec=2) |
| | 从已连接的套接字中阻塞接收指定长度的数据到char*容器 更多...
|
| |
| int | recvData (std::string &data, const uint64_t &length) |
| | 从已连接的套接字中接收一次数据到string字符串容器 更多...
|
| |
| int | recvData (char *data, const uint64_t &length) |
| | 从已连接的套接字中接收一次数据到char*容器 更多...
|
| |