Harry-YYM

Results 2 comments of Harry-YYM

我也遇到了同样的问题,请问有解决方案吗?

刚才我自己试了一下,在SendReq函数的最后增加一行代码退出当前连接即可: void HttpClient::SendReq(const std::string &url, const std::string &content, ReqCallback req_callback) { s_req_callback = req_callback; mg_mgr mgr; mg_mgr_init(&mgr, NULL); auto connection = mg_connect_http(&mgr, OnHttpEvent, url.c_str(), NULL, content.c_str()); mg_set_protocol_http_websocket(connection); printf("Send http request...