{"owner":"ithewei","repo":"libhv","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md"],"skills":{"AGENTS.md":"# AGENTS.md\n\nThis file provides guidance to agents when working with code in this repository.\n\n## Project Overview\n\nlibhv is a cross-platform C/C++ network library providing event-loop with non-blocking IO and timer. Core is C99, high-level wrappers are C++11. Compatible with gcc4.8+, MSVC2015+, clang. Supports Linux, Windows, macOS, Android, iOS, BSD, Solaris.\n\n## Build Commands\n\n### Makefile (primary, Unix)\n```bash\n./configure --with-openssl --with-http --with-mqtt --with-kcp  # configure options\nmake libhv          # build library only (shared + static)\nmake                # build library + examples\nmake examples       # build all example programs\nmake unittest       # compile unit tests\nmake evpp           # build C++ evpp tests (requires libhv built first)\nmake clean          # clean build artifacts\nsudo make install   # install to /usr/local/include/hv and /usr/local/lib\n```\n\n### CMake (cross-platform)\n```bash\nmkdir build && cd build\ncmake .. -DWITH_OPENSSL=ON -DWITH_HTTP=ON -DBUILD_EXAMPLES=ON\ncmake --build .\n# Windows: cmake .. -G \"Visual Studio 17 2022\" -A x64\n```\n\n### Bazel\n```bash\nbazel build libhv\n```\n\n### Package Managers\n```bash\nvcpkg install libhv    # vcpkg\nxrepo install libhv    # xmake\n```\n\n## Testing\n\n```bash\nmake unittest                 # compile all unit tests\nmake run-unittest             # compile and run unit tests (calls scripts/unittest.sh)\nbash scripts/unittest.sh      # run pre-built unit tests\nmake check                    # integration test: builds httpd, runs HTTP checks (scripts/check.sh)\n```\n\nRun a single unit test directly:\n```bash\nbin/rbtree_test    # or any test binary in bin/\n```\n\nRun evpp C++ tests (link against libhv):\n```bash\nmake evpp\nbin/TcpServer_test\nbin/EventLoop_test\n```\n\n## Key Configuration Options\n\nBuild flags via `./configure` or CMake `-D` options (see `config.ini` for defaults):\n\n| Makefile flag | CMake flag | Purpose |\n|---|---|---|\n| `--with-openssl` | `-DWITH_OPENSSL=ON` | SSL/TLS via OpenSSL |\n| `--with-gnutls` | `-DWITH_GNUTLS=ON` | SSL/TLS via GnuTLS |\n| `--with-mbedtls` | `-DWITH_MBEDTLS=ON` | SSL/TLS via mbedTLS |\n| `--with-nghttp2` | `-DWITH_NGHTTP2=ON` | HTTP/2 support |\n| `--with-kcp` | `-DWITH_KCP=ON` | KCP reliable UDP |\n| `--with-mqtt` | `-DWITH_MQTT=ON` | MQTT client |\n| `--with-protocol` | `-DWITH_PROTOCOL=ON` | ICMP, DNS, FTP, SMTP |\n| `--with-evpp` | `-DWITH_EVPP=ON` | C++ wrappers (default: yes) |\n| `--without-evpp` | `-DWITH_EVPP=OFF` | Pure C build, no C++ |\n| `--enable-uds` | `-DENABLE_UDS=ON` | Unix Domain Socket |\n| `--with-io-uring` | `-DWITH_IO_URING=ON` | io_uring event backend (Linux 5.1+) |\n\n## Architecture\n\n```\nApplication / Examples\n    │\n    ├── http/server, http/client   HTTP/WebSocket/gRPC (C++)\n    ├── mqtt/                      MQTT client (C)\n    ├── protocol/                  ICMP, DNS, FTP, SMTP (C)\n    │\n    ├── evpp/                      C++ wrappers: TcpServer, TcpClient, UdpServer, EventLoop\n    │\n    ├── event/                     Core event loop: hloop, hio, htimer\n    │   └── backends: epoll (Linux), kqueue (macOS/BSD), iocp/wepoll (Windows), io_uring (Linux 5.1+), select (fallback)\n    │   └── kcp/                   KCP reliable UDP transport\n    │\n    ├── ssl/                       Unified SSL interface (OpenSSL / GnuTLS / mbedTLS / platform)\n    │\n    ├── base/                      Platform abstraction, sockets, threads, logging, data structures\n    ├── util/                      C utilities (base64, md5, sha1)\n    └── cpputil/                   C++ utilities (string, path, file, json, threadpool, ini parser)\n```\n\n**Layering rules**: `base/` has no dependencies on other modules. `event/` depends on `base/` and `ssl/`. `evpp/` wraps `event/`. `http/` depends on `evpp/`. Higher layers are optional and controlled by build flags.\n\n**Public API entry point**: `hv.h` includes all base headers. Module-specific headers (e.g., `HttpServer.h`, `TcpServer.h`, `mqtt_client.h`) are the primary include for each feature. Installed headers go to `include/hv/`.\n\n**Key types**: `hloop_t` (event loop), `hio_t` (IO handle), `htimer_t` (timer) in the C API. `EventLoop`, `TcpServer`, `TcpClient`, `Channel` in the C++ API. `HttpRequest`, `HttpResponse`, `HttpService` for HTTP.\n\n## Code Style\n\n- **Formatting**: `.clang-format` — LLVM-based, 4-space indent, 160 column limit, pointer right-aligned, `catch`/`else` on new line (custom brace wrapping), no include sorting.\n- **C API naming**: `h` prefix for functions (`hloop_new`, `hio_read`), `_t` suffix for types (`hloop_t`, `hio_t`), UPPERCASE macros (`HV_EXPORT`).\n- **C++ API naming**: PascalCase classes (`EventLoop`, `TcpServer`), `hv` namespace.\n- **File naming**: lowercase with underscores (`.c` for C, `.cpp` for C++).\n- **Platform-specific code**: isolated via `hplatform.h` and `#ifdef` conditional compilation.\n\n## CI\n\nGitHub Actions (`.github/workflows/CI.yml`): builds and tests on Linux (with OpenSSL+nghttp2+KCP+MQTT), Windows (CMake + VS2022), macOS, Android (NDK cross-compile), iOS (Xcode cross-compile). Benchmark workflow runs echo-server throughput and HTTP performance comparisons.\n"},"files":{"AGENTS.md":"# AGENTS.md\n\nThis file provides guidance to agents when working with code in this repository.\n\n## Project Overview\n\nlibhv is a cross-platform C/C++ network library providing event-loop with non-blocking IO and timer. Core is C99, high-level wrappers are C++11. Compatible with gcc4.8+, MSVC2015+, clang. Supports Linux, Windows, macOS, Android, iOS, BSD, Solaris.\n\n## Build Commands\n\n### Makefile (primary, Unix)\n```bash\n./configure --with-openssl --with-http --with-mqtt --with-kcp  # configure options\nmake libhv          # build library only (shared + static)\nmake                # build library + examples\nmake examples       # build all example programs\nmake unittest       # compile unit tests\nmake evpp           # build C++ evpp tests (requires libhv built first)\nmake clean          # clean build artifacts\nsudo make install   # install to /usr/local/include/hv and /usr/local/lib\n```\n\n### CMake (cross-platform)\n```bash\nmkdir build && cd build\ncmake .. -DWITH_OPENSSL=ON -DWITH_HTTP=ON -DBUILD_EXAMPLES=ON\ncmake --build .\n# Windows: cmake .. -G \"Visual Studio 17 2022\" -A x64\n```\n\n### Bazel\n```bash\nbazel build libhv\n```\n\n### Package Managers\n```bash\nvcpkg install libhv    # vcpkg\nxrepo install libhv    # xmake\n```\n\n## Testing\n\n```bash\nmake unittest                 # compile all unit tests\nmake run-unittest             # compile and run unit tests (calls scripts/unittest.sh)\nbash scripts/unittest.sh      # run pre-built unit tests\nmake check                    # integration test: builds httpd, runs HTTP checks (scripts/check.sh)\n```\n\nRun a single unit test directly:\n```bash\nbin/rbtree_test    # or any test binary in bin/\n```\n\nRun evpp C++ tests (link against libhv):\n```bash\nmake evpp\nbin/TcpServer_test\nbin/EventLoop_test\n```\n\n## Key Configuration Options\n\nBuild flags via `./configure` or CMake `-D` options (see `config.ini` for defaults):\n\n| Makefile flag | CMake flag | Purpose |\n|---|---|---|\n| `--with-openssl` | `-DWITH_OPENSSL=ON` | SSL/TLS via OpenSSL |\n| `--with-gnutls` | `-DWITH_GNUTLS=ON` | SSL/TLS via GnuTLS |\n| `--with-mbedtls` | `-DWITH_MBEDTLS=ON` | SSL/TLS via mbedTLS |\n| `--with-nghttp2` | `-DWITH_NGHTTP2=ON` | HTTP/2 support |\n| `--with-kcp` | `-DWITH_KCP=ON` | KCP reliable UDP |\n| `--with-mqtt` | `-DWITH_MQTT=ON` | MQTT client |\n| `--with-protocol` | `-DWITH_PROTOCOL=ON` | ICMP, DNS, FTP, SMTP |\n| `--with-evpp` | `-DWITH_EVPP=ON` | C++ wrappers (default: yes) |\n| `--without-evpp` | `-DWITH_EVPP=OFF` | Pure C build, no C++ |\n| `--enable-uds` | `-DENABLE_UDS=ON` | Unix Domain Socket |\n| `--with-io-uring` | `-DWITH_IO_URING=ON` | io_uring event backend (Linux 5.1+) |\n\n## Architecture\n\n```\nApplication / Examples\n    │\n    ├── http/server, http/client   HTTP/WebSocket/gRPC (C++)\n    ├── mqtt/                      MQTT client (C)\n    ├── protocol/                  ICMP, DNS, FTP, SMTP (C)\n    │\n    ├── evpp/                      C++ wrappers: TcpServer, TcpClient, UdpServer, EventLoop\n    │\n    ├── event/                     Core event loop: hloop, hio, htimer\n    │   └── backends: epoll (Linux), kqueue (macOS/BSD), iocp/wepoll (Windows), io_uring (Linux 5.1+), select (fallback)\n    │   └── kcp/                   KCP reliable UDP transport\n    │\n    ├── ssl/                       Unified SSL interface (OpenSSL / GnuTLS / mbedTLS / platform)\n    │\n    ├── base/                      Platform abstraction, sockets, threads, logging, data structures\n    ├── util/                      C utilities (base64, md5, sha1)\n    └── cpputil/                   C++ utilities (string, path, file, json, threadpool, ini parser)\n```\n\n**Layering rules**: `base/` has no dependencies on other modules. `event/` depends on `base/` and `ssl/`. `evpp/` wraps `event/`. `http/` depends on `evpp/`. Higher layers are optional and controlled by build flags.\n\n**Public API entry point**: `hv.h` includes all base headers. Module-specific headers (e.g., `HttpServer.h`, `TcpServer.h`, `mqtt_client.h`) are the primary include for each feature. Installed headers go to `include/hv/`.\n\n**Key types**: `hloop_t` (event loop), `hio_t` (IO handle), `htimer_t` (timer) in the C API. `EventLoop`, `TcpServer`, `TcpClient`, `Channel` in the C++ API. `HttpRequest`, `HttpResponse`, `HttpService` for HTTP.\n\n## Code Style\n\n- **Formatting**: `.clang-format` — LLVM-based, 4-space indent, 160 column limit, pointer right-aligned, `catch`/`else` on new line (custom brace wrapping), no include sorting.\n- **C API naming**: `h` prefix for functions (`hloop_new`, `hio_read`), `_t` suffix for types (`hloop_t`, `hio_t`), UPPERCASE macros (`HV_EXPORT`).\n- **C++ API naming**: PascalCase classes (`EventLoop`, `TcpServer`), `hv` namespace.\n- **File naming**: lowercase with underscores (`.c` for C, `.cpp` for C++).\n- **Platform-specific code**: isolated via `hplatform.h` and `#ifdef` conditional compilation.\n\n## CI\n\nGitHub Actions (`.github/workflows/CI.yml`): builds and tests on Linux (with OpenSSL+nghttp2+KCP+MQTT), Windows (CMake + VS2022), macOS, Android (NDK cross-compile), iOS (Xcode cross-compile). Benchmark workflow runs echo-server throughput and HTTP performance comparisons.\n"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","title":"AGENTS.md","content":"# AGENTS.md\n\nThis file provides guidance to agents when working with code in this repository.\n\n## Project Overview\n\nlibhv is a cross-platform C/C++ network library providing event-loop with non-blocking IO and timer. Core is C99, high-level wrappers are C++11. Compatible with gcc4.8+, MSVC2015+, clang. Supports Linux, Windows, macOS, Android, iOS, BSD, Solaris.\n\n## Build Commands\n\n### Makefile (primary, Unix)\n```bash\n./configure --with-openssl --with-http --with-mqtt --with-kcp  # configure options\nmake libhv          # build library only (shared + static)\nmake                # build library + examples\nmake examples       # build all example programs\nmake unittest       # compile unit tests\nmake evpp           # build C++ evpp tests (requires libhv built first)\nmake clean          # clean build artifacts\nsudo make install   # install to /usr/local/include/hv and /usr/local/lib\n```\n\n### CMake (cross-platform)\n```bash\nmkdir build && cd build\ncmake .. -DWITH_OPENSSL=ON -DWITH_HTTP=ON -DBUILD_EXAMPLES=ON\ncmake --build .\n# Windows: cmake .. -G \"Visual Studio 17 2022\" -A x64\n```\n\n### Bazel\n```bash\nbazel build libhv\n```\n\n### Package Managers\n```bash\nvcpkg install libhv    # vcpkg\nxrepo install libhv    # xmake\n```\n\n## Testing\n\n```bash\nmake unittest                 # compile all unit tests\nmake run-unittest             # compile and run unit tests (calls scripts/unittest.sh)\nbash scripts/unittest.sh      # run pre-built unit tests\nmake check                    # integration test: builds httpd, runs HTTP checks (scripts/check.sh)\n```\n\nRun a single unit test directly:\n```bash\nbin/rbtree_test    # or any test binary in bin/\n```\n\nRun evpp C++ tests (link against libhv):\n```bash\nmake evpp\nbin/TcpServer_test\nbin/EventLoop_test\n```\n\n## Key Configuration Options\n\nBuild flags via `./configure` or CMake `-D` options (see `config.ini` for defaults):\n\n| Makefile flag | CMake flag | Purpose |\n|---|---|---|\n| `--with-openssl` | `-DWITH_OPENSSL=ON` | SSL/TLS via OpenSSL |\n| `--with-gnutls` | `-DWITH_GNUTLS=ON` | SSL/TLS via GnuTLS |\n| `--with-mbedtls` | `-DWITH_MBEDTLS=ON` | SSL/TLS via mbedTLS |\n| `--with-nghttp2` | `-DWITH_NGHTTP2=ON` | HTTP/2 support |\n| `--with-kcp` | `-DWITH_KCP=ON` | KCP reliable UDP |\n| `--with-mqtt` | `-DWITH_MQTT=ON` | MQTT client |\n| `--with-protocol` | `-DWITH_PROTOCOL=ON` | ICMP, DNS, FTP, SMTP |\n| `--with-evpp` | `-DWITH_EVPP=ON` | C++ wrappers (default: yes) |\n| `--without-evpp` | `-DWITH_EVPP=OFF` | Pure C build, no C++ |\n| `--enable-uds` | `-DENABLE_UDS=ON` | Unix Domain Socket |\n| `--with-io-uring` | `-DWITH_IO_URING=ON` | io_uring event backend (Linux 5.1+) |\n\n## Architecture\n\n```\nApplication / Examples\n    │\n    ├── http/server, http/client   HTTP/WebSocket/gRPC (C++)\n    ├── mqtt/                      MQTT client (C)\n    ├── protocol/                  ICMP, DNS, FTP, SMTP (C)\n    │\n    ├── evpp/                      C++ wrappers: TcpServer, TcpClient, UdpServer, EventLoop\n    │\n    ├── event/                     Core event loop: hloop, hio, htimer\n    │   └── backends: epoll (Linux), kqueue (macOS/BSD), iocp/wepoll (Windows), io_uring (Linux 5.1+), select (fallback)\n    │   └── kcp/                   KCP reliable UDP transport\n    │\n    ├── ssl/                       Unified SSL interface (OpenSSL / GnuTLS / mbedTLS / platform)\n    │\n    ├── base/                      Platform abstraction, sockets, threads, logging, data structures\n    ├── util/                      C utilities (base64, md5, sha1)\n    └── cpputil/                   C++ utilities (string, path, file, json, threadpool, ini parser)\n```\n\n**Layering rules**: `base/` has no dependencies on other modules. `event/` depends on `base/` and `ssl/`. `evpp/` wraps `event/`. `http/` depends on `evpp/`. Higher layers are optional and controlled by build flags.\n\n**Public API entry point**: `hv.h` includes all base headers. Module-specific headers (e.g., `HttpServer.h`, `TcpServer.h`, `mqtt_client.h`) are the primary include for each feature. Installed headers go to `include/hv/`.\n\n**Key types**: `hloop_t` (event loop), `hio_t` (IO handle), `htimer_t` (timer) in the C API. `EventLoop`, `TcpServer`, `TcpClient`, `Channel` in the C++ API. `HttpRequest`, `HttpResponse`, `HttpService` for HTTP.\n\n## Code Style\n\n- **Formatting**: `.clang-format` — LLVM-based, 4-space indent, 160 column limit, pointer right-aligned, `catch`/`else` on new line (custom brace wrapping), no include sorting.\n- **C API naming**: `h` prefix for functions (`hloop_new`, `hio_read`), `_t` suffix for types (`hloop_t`, `hio_t`), UPPERCASE macros (`HV_EXPORT`).\n- **C++ API naming**: PascalCase classes (`EventLoop`, `TcpServer`), `hv` namespace.\n- **File naming**: lowercase with underscores (`.c` for C, `.cpp` for C++).\n- **Platform-specific code**: isolated via `hplatform.h` and `#ifdef` conditional compilation.\n\n## CI\n\nGitHub Actions (`.github/workflows/CI.yml`): builds and tests on Linux (with OpenSSL+nghttp2+KCP+MQTT), Windows (CMake + VS2022), macOS, Android (NDK cross-compile), iOS (Xcode cross-compile). Benchmark workflow runs echo-server throughput and HTTP performance comparisons.\n","category":"root","tokens":1278}]}