{"id":20721396,"url":"https://github.com/calvinneo/atp","last_synced_at":"2025-08-19T10:15:23.421Z","repository":{"id":89526379,"uuid":"111268110","full_name":"CalvinNeo/ATP","owner":"CalvinNeo","description":"A transmission protocol implementation based on UDP, inspired by libutp","archived":false,"fork":false,"pushed_at":"2020-10-16T05:00:17.000Z","size":203,"stargazers_count":28,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-23T15:14:37.938Z","etag":null,"topics":["network","udp-socket"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CalvinNeo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2017-11-19T05:43:50.000Z","updated_at":"2024-03-10T01:13:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f1399c9-a890-474a-a0ff-9ee23b795f14","html_url":"https://github.com/CalvinNeo/ATP","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalvinNeo%2FATP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalvinNeo%2FATP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalvinNeo%2FATP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalvinNeo%2FATP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CalvinNeo","download_url":"https://codeload.github.com/CalvinNeo/ATP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250457792,"owners_count":21433734,"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":["network","udp-socket"],"created_at":"2024-11-17T03:27:23.377Z","updated_at":"2025-04-23T15:14:46.026Z","avatar_url":"https://github.com/CalvinNeo.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ATP\n\nATP is a message-oriented reliable transport protocol implementation.\n\n[![Build Status](https://travis-ci.org/CalvinNeo/ATP.svg?branch=master)](https://travis-ci.org/CalvinNeo/ATP)  [![Coverage Status](https://coveralls.io/repos/github/CalvinNeo/ATP/badge.svg?branch=master)](https://coveralls.io/github/CalvinNeo/ATP?branch=master)\n\n# Overview\n1. ATP provides reliable transportation of data as well as a series of TCP's features.\n2. ATP has a small sized head.\n3. ATP allows time critical data transmission by urgent mechanism and clock drift probing.\n4. ATP allows multiple connections established over the same port. \n5. ATP has a lightweight connecting/disconnecting mechanism. You can \"fork\" an established connection in ATP without extra 3-way handshake. You will endure shorter TIME\\_WAIT stage than TCP.\n6. ATP provides a framework as well as a service.\n\n# Build\n## Requirements\n1. C++17 standard(e.g. g++7.2)\n\n## Build\nMake the project by command\n\n    make lib\n\nRun test on demos by command\n    \n    make run_test\n\n## APIs\nAll APIs are available in [/src/atp.h](/src/atp.h), and is compatible with C89\n\n\n# ATP as a framework(ASAF)\nWhen ATP is used as a framework, it provides with a flexible underlying control. In this case, You must handle incoming UDP packets and maintain a timer outside the ATP framework. You must interact with the ATP context through two APIs:\n1. `atp_process_udp`\n    When there's an incoming UDP packet, you must inform ATP context to parse the raw UDP packet by calling `atp_process_udp`, the context will then dispatch the packets to correct ATP sockets. \n2. `atp_timer_event`\n    You must also maintain a timer, and call `atp_timer_event` to generate timer signals for the context. \n\nASAF is not thread safe.\n\n## Demos\nMost of these demos use healper `atp_standalone_` APIs provided in [/src/atp_standalone.h](/src/atp_standalone.h). These APIs help you from coding the connect/disconnect procedure yourself.\n\nYou can build all following tests by\n    \n    make demos\n\n1. sendfile/recvfile\n\n    The demo includes two separated programs: the sender and the receiver. A File will be sent from the sender to the receiver. In this demo, both sides set their UDP Socket to be nonblock, because there will be no multi-threading or multiplexing.\n    You can set loss rate by modifying function `simulate_packet_loss_sendto` in [/src/atp_callback.cpp](/src/atp_callback.cpp).\n\n    Build this demo by\n\n        make test TARGET=demo_file\n\n2. send/recv\n\n    This demo is similar to sendfile/recvfile, instead of sending file, send/recv use stdin/stdout now. You can run with argument `-s` to simulate a ATPPacket by commands with certain format. This demo provides a convenient test method.\n    Build this demo by\n\n        make test TARGET=demo_cmd\n\n3. send_poll\n\n    This demo implements the sendfile's part with `poll`.\n\n    Build this demo by\n\n        make test TARGET=demo_poll\n\n4. send_aio\n\n    This demo implements the sendfile's part with aio.\n\n    Build this demo by\n    \n        make test TARGET=send_aio\n\n# ATP as a service\n## Demos\n\n# Docs\n[/docs/brief.md](/docs/brief.md)\n\n# License\nThe whole project is opened under GNU GENERAL PUBLIC LICENSE Version 2.\n\n                        GNU GENERAL PUBLIC LICENSE\n                           Version 2, June 1991\n\n    Calvin Neo\n    Copyright (C) 2017  Calvin Neo\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License along\n    with this program; if not, write to the Free Software Foundation, Inc.,\n    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalvinneo%2Fatp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalvinneo%2Fatp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalvinneo%2Fatp/lists"}