libhv
libhv copied to clipboard
🔥 比libevent/libuv/asio更易用的网络库。A c/c++ network library for developing TCP/UDP/SSL/HTTP/WebSocket/MQTT client/server.
websocket服务端,三个回调函数,都增加第三个参数:用户数据   这样,我初始化server.registerWebSocketService(&ws);的时候,就可以把所谓的上下文添加到回调函数中,回调函数返回时,直接返回对应的用户数据,也就是上下文 同理,客户端也是
dtls 支持
现在libhv有tls支持但是缺官方dtls支持 是否有考虑过官方dtls支持 现在用应用层做的dtls就得改成mem_bio的形式才能用比较麻烦 而官方udp是所有服务都采用同一个fd ,openssl 下面 ssl_read 函数调用 recvfrom fd的形式实现 当同时接到多个dtls client数据时 openssl做连续解析 两条不同client的密文必然会解密失败
最近使用libhv测试IPV4报文拆包,发现拆分后的报文异常,设置如下: //拆包规则 unpack_setting_t protorpc_unpack_setting; memset(&protorpc_unpack_setting, 0, sizeof(unpack_setting_t)); protorpc_unpack_setting.mode = UNPACK_BY_LENGTH_FIELD; protorpc_unpack_setting.package_max_length = 16000; protorpc_unpack_setting.body_offset = 20; protorpc_unpack_setting.length_field_offset = 2; protorpc_unpack_setting.length_field_bytes = 2; protorpc_unpack_setting.length_field_coding = ENCODE_BY_BIG_ENDIAN; cli.setUnpack(&protorpc_unpack_setting); 分析libhv代码发现hio_unpack_by_length_field()里实际header和body加起来才是package_len,IPv4的头部字段的长度实际是整个报文长度,这样就会实际超出真实的数据长度; libhv原生代码是 package_len =...
So sorry if there already is a way to do this, I couldn't find this one. The onclose callback currently passes no arguments, could it be made so that it...
How can I enable MBedTLS on CMake ? GUI doesn't ask paths for include and .lib. So, is there any terminal command or environment variable value ? package manager usage...
文件:mqtt_client.c 代码:if (cid_len == 0) cli->clean_session = 1; 应改成:if (cid_len > 0) cli->clean_session = 1; 现在未开放clean_session接口;不设置的话一直不自动清会话; 临时设置进行clean_session if(m_ptrMqttClient->client) { m_ptrMqttClient->client->clean_session = 1; }
1. The length of the macro MAX_PATH is only 260, isn't it really too small? 2. The logdir directly reads the running directory, then creates and uses the directory logs...
添加win32共享库版本资源是因为标准规范以及便于识别版本信息与某些杀软有文件资源特征要求 添加win32共享库lib前缀是因为hv.dll相比较libhv.dll辨识度更好也利于推广以及搜索引擎关键字匹配 添加unix/linux 环境共享库版本是因为SO-NAME标准化规范兼容性管理 更新nlohmann到23年发布的3.11.3 [问题类似这个issues,在群里也遇到其他人被这个问题给坑了](https://github.com/ithewei/libhv/issues/453) 去除unix/linux环境编译的静态库_static后缀是因为不便于标准编译参数自动.a与.so
Why not provide a fourth field to store the option description and a function to automatically generate and output help
Xmake is also a build system developed by Chinese developers, and I think you can also provide a build configuration file for xmake. Chinese developers are very good, and xmake...