{"id":17060396,"url":"https://github.com/inetic/asio-utp","last_synced_at":"2026-02-28T07:00:07.307Z","repository":{"id":146907862,"uuid":"133415134","full_name":"inetic/asio-utp","owner":"inetic","description":"Boost.Asio wrapper over uTorrent's uTP library","archived":false,"fork":false,"pushed_at":"2021-06-02T16:15:05.000Z","size":138,"stargazers_count":27,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-20T07:58:40.620Z","etag":null,"topics":["asio","cpp","cpp14","utp"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inetic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-05-14T20:04:24.000Z","updated_at":"2024-06-13T08:20:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"4a2622e6-e4da-4512-ab75-dd23874f249a","html_url":"https://github.com/inetic/asio-utp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/inetic/asio-utp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inetic%2Fasio-utp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inetic%2Fasio-utp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inetic%2Fasio-utp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inetic%2Fasio-utp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inetic","download_url":"https://codeload.github.com/inetic/asio-utp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inetic%2Fasio-utp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29927161,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asio","cpp","cpp14","utp"],"created_at":"2024-10-14T10:43:38.737Z","updated_at":"2026-02-28T07:00:04.776Z","avatar_url":"https://github.com/inetic.png","language":"C++","readme":"[![CircleCI](https://circleci.com/gh/inetic/asio-utp/tree/master.svg?style=shield)](https://circleci.com/gh/inetic/asio-utp/tree/master)\n\n# Asio wrapper over the uTorrent's (MIT licensed) uTP library\n\n## Features\n\nSimilar API to the TCP sockets in Asio.  In particular, the `utp::socket`\nimplements the [`AsyncReadStream`] and [`AsyncWriteStream`] requirements.\nMaking it readily usable with Asio's free functions or classes utilizing those\nrequirements. Such as [`async_read`], [`async_write`], [`ssl::stream`], ...\n\nAlso similar to Asio's TCP sockets, `utp::socket`'s `async` API supports\ncallbacks, futures and coroutines as completion tokens.\n\nThe `asio_utp::udp_multiplexer` can be used to perform non uTP sending and\nreceiving of UDP datagrams.\n\n## Advantages of uTP over TCP\n\n* Multiple uTP connections over one UDP port implies\n    * better options to do NAT hole-punching\n    * free hole-punching on certain types of NATs\n    * fewer open file descriptors\n* Low latency\n* Yields to TCP\n\n## Clone\n\n`asio-utp` git repository contains `libutp` (the uTorrents uTP library written in C)\nas a submodule. Thus one has to clone it recursively:\n\n```\ngit clone --recursive git@github.com:inetic/asio-utp.git\n```\n\n## Build\n\n```\ncd asio-utp\nmkdir build\ncd build\ncmake .. -DBOOST_ROOT=\u003cPATH_TO_BOOST_DIRECTORY\u003e\nmake -j$(nproc)\n```\n\nFor more detailed instructions, have a look at the `.circleci/config.yml` file.\n\n## Caveats\n\n* An __accepting__ socket may only start sending **after** it received some data\n  from the __connecting__ socket (likely a consequence of\n  [this](https://github.com/bittorrent/libutp/issues/74))\n* One has to implement their own timeouts and keep-alive packets because\n  otherwise if the FIN UDP packet gets dropped by the network then the\n  remaining socket won't get destroyed. Note that there is a mention of\n  keep-alive packets in `libutp/utp_internals.c`, but those seem to be only\n  used for preserving holes in NATs (not to indicate whether the other end\n  is still alive).\n* The call to `socket::async_connect` simply executes the underlying\n  `libutp/utp_connect` function. The latter sends one SYN packet but does not\n  implement any timeout nor resending of that packet. This needs to be done\n  explicitly by closing the socket after some timeout and then re-starting\n  the call to `socket::async_connect`.\n\n## Architecture\n\n```\n    asio_utp::socket --- asio_utp::socket_impl ---+\n                                                   \\\n    asio_utp::socket --- asio_utp::socket_impl -----+--- asio_utp::context\n                                                   /             \\\n    asio_utp::socket --- asio_utp::socket_impl ---+               \\\n                                                                   \\\n                                          +----------- asio_utp::udp_multiplexer_impl\n    asio_utp::udp_multiplexer ---+       /                              \\\n                                  \\     /                                \\\n    asio_utp::udp_multiplexer -----+---+                          asio::udp::socket\n                                  /\n    asio_utp::udp_multiplexer ---+\n```\n\n## TODO\n\n* Handle ICMP messages\n* Thread safety\n\n\n[`AsyncReadStream`]:  https://www.boost.org/doc/libs/1_69_0/doc/html/boost_asio/reference/AsyncReadStream.html\n[`AsyncWriteStream`]: https://www.boost.org/doc/libs/1_69_0/doc/html/boost_asio/reference/AsyncWriteStream.html\n[`async_read`]:       https://www.boost.org/doc/libs/1_69_0/doc/html/boost_asio/reference/async_read.html\n[`async_write`]:      https://www.boost.org/doc/libs/1_69_0/doc/html/boost_asio/reference/async_write.html\n[`ssl::stream`]:      https://www.boost.org/doc/libs/1_69_0/doc/html/boost_asio/reference/ssl__stream.html\n[API]:                https://github.com/inetic/asio-utp/blob/master/include/asio_utp/socket.hpp#L15\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finetic%2Fasio-utp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finetic%2Fasio-utp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finetic%2Fasio-utp/lists"}