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

代码如下 ```c std::shared_ptr RequestPbf(const std::string& url, const std::string& path, const std::string& body, HttpContextPtr ctx) { HttpRequestPtr req(new HttpRequest); req->method = HTTP_POST; req->url = url + path; req->headers["Connection"] = "keep-alive"; req->body...

``` #include "hv/WebSocketServer.h" using namespace hv; int main(int argc, char** argv) { WebSocketService ws; ws.onopen = [](const WebSocketChannelPtr& channel, const HttpRequestPtr& req) { printf("onopen: GET %s\n", req->Path().c_str()); }; ws.onmessage =...

请添加组播功能支持 please add support to multicast utility func like this ``` bool is_multicast_addr(const char* addr) { //ipv4 only addr = ntohl(inet_addr(addr)); return (addr >> 28) == 0xE; } // IP_MULTICAST_IF...

help wanted

协议报文本身多变,body长度的字段 可能在 body_offset之后。所以这里的assert是不正常的提示。 例如,报文是 [0xff, 0xff, 0x3, 0x2(长度字段), 0xA], 前两个字节是head,0x3是类型,0x2是body_len(0x3和0x2两个字节),0xA是校验位 设置时候,body_offset= 2,length_field_offset= 3,length_field_bytes=1, length_adjustment= 1。 这里与assert相悖,所以应该去除assert语句。

Without the change build on `gcc-13` fails as: [ 98%] Built target hmain_test In file included from /build/source/examples/mqtt/mqtt_client_test.cpp:10: /build/source/examples/../mqtt/mqtt_client.h: In member function 'int hv::MqttClient::publish(const std::string&, const std::string&, int, int, MqttCallback)':...

add UDP group IPV4 & IPV6 join group, leave group.

在https://github.com/ithewei/libhv/issues/251 中看到有UDP组播需求,我这里也正好有这个需求。 仿`udp_broadcast()`接口实现了一个。名称参考Qt的`joinMulticastGroup()`、`leaveMulticastGroup()`接口,但区分IPv4和IPv6两个版本。总共4个接口 ``` HV_INLINE int udp_joinmulticastgroupv4(int sockfd, const char* group, const char* local_host); HV_INLINE int udp_leavemulticastgroupv4(int sockfd, const char* group, const char* local_host); HV_INLINE int udp_joinmulticastgroupv6(int sockfd, const char*...

当网卡配置多个静态ip时,使用ifcofig方法只能返回第一个ip,不能全部获取

Only grpc server sample found in this repository. Is the official grpc c++ library required?