We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
原生demo的http-client 连续发的两个请求,handle_func仅执行了一次。
The text was updated successfully, but these errors were encountered:
我也遇到了同样的问题,请问有解决方案吗?
Sorry, something went wrong.
刚才我自己试了一下,在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 %s\n", url.c_str()); // loop while (s_exit_flag == 0) mg_mgr_poll(&mgr, 500); mg_mgr_free(&mgr); s_exit_flag = 0;//增加这一行即可
}
No branches or pull requests
原生demo的http-client
连续发的两个请求,handle_func仅执行了一次。
The text was updated successfully, but these errors were encountered: