{"id":17397773,"url":"https://github.com/bltavares/async-std-utp","last_synced_at":"2025-04-15T04:23:36.942Z","repository":{"id":39115610,"uuid":"372568193","full_name":"bltavares/async-std-utp","owner":"bltavares","description":"A µTP (Micro/uTorrent/utp Transport Library) library implemented in Rust and async-std","archived":false,"fork":false,"pushed_at":"2021-11-15T08:04:10.000Z","size":1050,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T15:51:48.248Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bltavares.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-31T16:28:52.000Z","updated_at":"2022-06-24T01:54:52.000Z","dependencies_parsed_at":"2022-08-25T07:31:03.891Z","dependency_job_id":null,"html_url":"https://github.com/bltavares/async-std-utp","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bltavares%2Fasync-std-utp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bltavares%2Fasync-std-utp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bltavares%2Fasync-std-utp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bltavares%2Fasync-std-utp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bltavares","download_url":"https://codeload.github.com/bltavares/async-std-utp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248694545,"owners_count":21146945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-16T14:15:46.178Z","updated_at":"2025-04-15T04:23:36.926Z","avatar_url":"https://github.com/bltavares.png","language":"Rust","readme":"# async-std-utp\n\n\u003ca href=\"https://github.com/bltavares/async-std-utp/actions?query=workflow%3AQuickstart+branch%3Amaster\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/workflow/status/bltavares/async-std-utp/Quickstart/master?label=main%20ci\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/bltavares/async-std-utp/actions?query=workflow%3ACross-compile+branch%3Amaster\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/workflow/status/bltavares/async-std-utp/Cross-compile/master?label=cross%20ci\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://crates.io/crates/async-std-utp\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/v/async-std-utp.svg\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://docs.rs/async-std-utp\"\u003e\n    \u003cimg src=\"https://docs.rs/async-std-utp/badge.svg\" /\u003e\n\u003c/a\u003e\n\nA [Micro Transport Protocol](http://www.bittorrent.org/beps/bep_0029.html)\nlibrary implemented in Rust - integrated with [async-std](https://async.rs).\n\n## Overview\n\nThe Micro Transport Protocol is a reliable transport protocol built over\nUDP. Its congestion control algorithm is\n[LEDBAT](http://tools.ietf.org/html/rfc6817), which tries to use as much unused\nbandwidth as it can but readily yields to competing flows, making it useful for\nbulk transfers without introducing congestion in the network.\n\nThe current implementation is somewhat incomplete, lacking a complete implementation of congestion\ncontrol. However, it does support packet loss detection (except by timeout) the\nSelective Acknowledgment extension, handles unordered and duplicate packets and\npresents a stream interface (`UtpStream`).\n\n## Usage\n\nTo use `async-std-utp`, add this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nasync-std-utp = \"*\"\n```\n\n## Examples\n\nThe simplest example program would be:\n\n```rust\n\nuse async_std_utp::UtpStream;\nuse async_std::prelude::*;\n\n#[async_std::main]\nasync fn main() {\n    // Connect to an hypothetical local server running on port 8080\n    let addr = \"127.0.0.1:8080\";\n    let mut stream = UtpStream::connect(addr).await.expect(\"Error connecting to remote peer\");\n\n    // Send a string\n    stream.write(\"Hi there!\".as_bytes()).await.expect(\"Write failed\");\n\n    // Close the stream\n    stream.close().await.expect(\"Error closing connection\");\n}\n```\n\nCheck out the files under the \"examples\" directory for more example programs, or run them with `cargo run --example \u003cexample_name\u003e`.\n\n## Roadmap\n\n- [x] congestion control\n- [x] proper connection closing\n  - [x] handle both RST and FIN\n  - [x] send FIN on close\n  - [x] automatically send FIN on `drop` if not already closed\n- [x] sending RST on mismatch\n- [x] setters and getters that hide header field endianness conversion\n- [x] SACK extension\n- [x] handle packet loss\n  - [x] send triple-ACK to re-request lost packet (fast resend request)\n  - [x] rewind send window and resend in reply to triple-ACK (fast resend)\n  - [x] resend packet on ACK timeout\n- [x] stream interface\n- [x] handle unordered packets\n- [x] duplicate packet handling\n- [x] listener abstraction\n- [x] incoming connections iterator\n- [x] time out connection after too many retransmissions\n- [ ] path MTU discovery\n\n## License\n\nThis library is distributed under similar terms to Rust: dual licensed under the MIT license and the Apache license (version 2.0).\n\nSee LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.\n\n## Considerations\n\nBased on the work of [rust-utp](https://github.com/meqif/rust-utp). Thank you.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbltavares%2Fasync-std-utp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbltavares%2Fasync-std-utp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbltavares%2Fasync-std-utp/lists"}