ithewei
ithewei
HttpContextPtr defined in HttpContext.h https://github.com/ithewei/libhv/blob/41f679e0c7050ddd9f45d48275ab6cdfc940558e/http/server/HttpContext.h#L211
按道理是应该删,但之前有Qt项目没有使用cmake,没法执行cmake configure或者./configure,所以提供了一份默认的hconfig.h
应该没事,不过cur_hrtime没有及时更新的原因可能是因为你在响应回调里做了太多耗时操作?正确情况下至少100ms会调用一次hloop_update_time(loop)来更新这个值的
出错时`pAddr->AdapterName`的值显示什么?
https://github.com/ithewei/libhv/pull/777 这个PR应该修复了这个问题
根据你的描述和贴的代码,我没有看出什么原因,不过有几个问题可以指出下: 1、WebSocketClient::open内部本身会创建线程,所以你外部没必要再创建线程了,有点多此一举; 2、对于非阻塞写,内部while循环发消息是不对的,需要做流控,控制写入速度,判断可写时再发,具体可以设置ws->onWriteComplete,以及通过ws->isWriteCompleted来判断,不做流控不断的写入,可能导致内部写缓存到达限制后,为了避免内存占用过大,自动断开链接;
事件循环的回调里是不能做阻塞或者耗时操作的,否则会阻塞事件循环线程的执行,我看你在上面Send函数里还做了等待响应的操作,这个是不合理的,应该在onMessage里去处理响应,而不是阻塞等待响应。
Try `cmake -DOPENSSL_ROOT_DIR=/path/to/openssl`
First of all, you need to have a compiled openssl library of arm64 version locally, otherwise how can you find and link openssl libraries?
Normally, WebSocketClient::close or stop will closesocket. You can try the [examples/websocket_client_test.cpp](https://github.com/ithewei/libhv/blob/master/examples/websocket_client_test.cpp)