{"repo":"mas-bandwidth/reliable","free":true,"listed":false,"github":"https://github.com/mas-bandwidth/reliable","clone":"git clone https://github.com/mas-bandwidth/reliable.git","description":"Packet acknowledgement system for UDP","language":"C","stars":654,"topics":["udp","ack","rtt","mtu","protocol","game-development","fragmentation"],"license":"BSD-3-Clause","category":"game-templates","readme_excerpt":"Introduction reliable is a simple packet acknowledgement system for UDP-based protocols. It's useful in situations where you need to know which UDP packets you sent were received by the other side. It has the following features: 1. Acknowledgement when packets are received 2. Packet fragmentation and reassembly 3. RTT, jitter and packet loss estimates 4. Duplicate packets are detected and dropped reliable is stable and production ready. Usage Reliable is designed to operate with your own network socket library. If you don't have one already, try netcode, it's designed to work well with reliable. First, create an endpoint on each side of the connection: For example, in a client/server setup you would have one endpoint on each client, and n endpoints on the server, one for each client slot. Next, create a function to transmit packets: And a function to process received packets: For each packet you receive from your udp socket, call this on the endpoint that should receive it: Now you can send packets through the endpoint: And get acks like this: Once you process all acks, clear them: Before you send a packet, you can ask reliable what sequence number the sent packet will have: This way you can map acked sequence numbers to the contents of packets you sent, for example, resending unacked messages until a packet that included that message was acked. Make sure to update each endpoint once per-frame. This keeps track of network stats like latency, jitter, packet loss and bandwidth:","default_branch":null,"files":null,"tree":[],"storefront":"/r/mas-bandwidth","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mas-bandwidth/reliable/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}