libhv icon indicating copy to clipboard operation
libhv copied to clipboard

🔥 比libevent/libuv/asio更易用的网络库。A c/c++ network library for developing TCP/UDP/SSL/HTTP/WebSocket/MQTT client/server.

Results 86 libhv issues
Sort by recently updated
recently updated
newest added

作者你好,我使用了大约8-10个httpclient进行并发异步请求,会发现在一些情况下,执行回掉函数的时间会比我设计的timeout参数要少。 在进行log调试后,发现原因出现在AsyncHttpClient中task->start_time = hloop_now_hrtime(loop); 这句话是为了后续计算elapsed用来设置定时起任务: int elapsed_ms = (now_hrtime - task->start_time) / 1000; 但是hloop_now_hrtime只是单纯的获取loop->cur_hrtime,并没有更新。这导致取到了很久之前残留的cur_time,从而使得elapsed被高估,进而导致设置定时器时实际时长低于预先设置好的timeout参数。 目前我在hloop_now_hrtime函数里调用了hloop_update_time方法,但不知道是否有其他副作用。 uint64_t hloop_now_hrtime(hloop_t* loop) { hloop_update_time(loop); return loop->cur_hrtime; }

之前存在的问题, 如果网络异常导致的连接断开,会收到一次onClose. 如果配置了自动重连会去重连. 然而 当重连的时候 socket 创建失败(网络异常导致). 则无法收到任何异常信息,且不会再次执行重连。 本次修改后, 即使网卡未就绪,网络连接未通,如果配置了重连,依旧会根据重连规则去重试,如果未配置自动重连,则返回-1. 即使是网络异常导致的产生了一次onClose 重连失败时,重连动作依有效。

在windows xp系统下 使用 InterlockedExchangeAdd 替代 InterlockedAdd API.

Hi ithewei, I have created a websocketclient connected to a remote WSS server. However I am unable to close/stop the client from the client side, even after calling `stop` method...

Hi I'm trying to cross-compile for arm64 with OpenSSL. When using cmake, findpackage searches for OpenSSL from x86 and not from the toolchain. When compiling, the error below is generated...

![image](https://github.com/user-attachments/assets/e8562056-1af4-463d-bafa-b375356d04bb)

This is nothing big, but when configuring the project with CMake, the source directory is modified, which shows changes to stage in my git status message and in my editor,...

Verifying the websocket server's certificate requires a filename: ```cpp // m_conn is a hv::WebSocketClient hssl_ctx_opt_t param{}; param.endpoint = HSSL_CLIENT; param.verify_peer = 1; param.ca_file = "W:\\path\\to\\cert.pem"; int tls_result = m_conn.withTLS(&param); ```...

不同长度的整型使用这些原子操作接口时得到的结果不正确。 比如:`atomic_flag_test_and_set`函数(内部代码:`InterlockedCompareExchange((LONG*)&p->_Value, 1, 0)`)调用后并不能让atomic_flag置1。 还有这些原子操作接口在不同平台下的返回值不同。比如我用来实现引用计数的代码: ```c if (ATOMIC_DEC(&ref->refcnt) == 1) { release_cb(ref); } ``` 在linux下,`ATOMIC_DEC`返回的减少之前的值,而在windows下返回的是减少之后的值,这导致这段代码在Windows下不正确。