Spaces:
Paused
Paused
class tcpBoltConfig | |
{ | |
public: | |
uint32_t request_id; | |
uint32_t session_id; | |
std::string signal_id; | |
std::string data_st; | |
bool encrypt = false; | |
CRYPT_TYPE ept_type; | |
char ept_key; | |
}; | |
class TcpClientBolt { | |
public: | |
TcpClientBolt(hio_t* _io) : io(_io) {} | |
bool hasHandshake() { return cli.isConnected(); } | |
bool handShake(void* buf, int readbytes); | |
int send(char* data, int size); | |
void close(); | |
private: | |
bool connect(struct sockaddr* addr); | |
void onConnection(const hv::SocketChannelPtr &channel); | |
void onDisConnection(const hv::SocketChannelPtr &channel); | |
void onRecv(const hv::SocketChannelPtr &channel, hv::Buffer *buf); | |
void onWrited(const hv::SocketChannelPtr &channel, hv::Buffer *buf); | |
private: | |
hv::TcpClient cli; | |
hio_t* io; | |
struct sockaddr_in t_addr, u_addr; | |
uint32_t session_id; | |
bool is_bolt_server; | |
tcpBoltConfig *config; | |
}; | |