{"id":13678322,"url":"https://github.com/RevenantX/LiteNetLib","last_synced_at":"2025-04-29T13:30:25.905Z","repository":{"id":37412965,"uuid":"49737156","full_name":"RevenantX/LiteNetLib","owner":"RevenantX","description":"Lite reliable UDP library for Mono and .NET","archived":false,"fork":false,"pushed_at":"2024-11-06T13:35:14.000Z","size":8638,"stargazers_count":3076,"open_issues_count":10,"forks_count":497,"subscribers_count":152,"default_branch":"master","last_synced_at":"2024-11-06T14:28:13.263Z","etag":null,"topics":["cross-platform","csharp","dot-net","mono","network","networking","reliable-packets","udp","unity-3d"],"latest_commit_sha":null,"homepage":"https://revenantx.github.io/LiteNetLib/index.html","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RevenantX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.paypal.com/donate/?business=G9PDX5KLGKBA2\u0026no_recurring=0\u0026currency_code=USD"]}},"created_at":"2016-01-15T18:28:35.000Z","updated_at":"2024-11-05T00:05:51.000Z","dependencies_parsed_at":"2023-02-02T17:16:32.630Z","dependency_job_id":"bbb5909d-17e2-4258-a133-3eafcaa93a98","html_url":"https://github.com/RevenantX/LiteNetLib","commit_stats":{"total_commits":1083,"total_committers":68,"mean_commits":"15.926470588235293","dds":"0.20590951061865193","last_synced_commit":"c81e1b553ba9c713e0393f0bb441ada7b1d9acbd"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RevenantX%2FLiteNetLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RevenantX%2FLiteNetLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RevenantX%2FLiteNetLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RevenantX%2FLiteNetLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RevenantX","download_url":"https://codeload.github.com/RevenantX/LiteNetLib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224124953,"owners_count":17259746,"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":["cross-platform","csharp","dot-net","mono","network","networking","reliable-packets","udp","unity-3d"],"created_at":"2024-08-02T13:00:52.372Z","updated_at":"2025-04-29T13:30:25.894Z","avatar_url":"https://github.com/RevenantX.png","language":"C#","readme":"# LiteNetLib\r\n\r\nLite reliable UDP library for .NET Standard 2.0 (Mono, .NET Core, .NET Framework)\r\n\r\n[![Made in Ukraine](https://img.shields.io/badge/made_in-ukraine-ffd700.svg?labelColor=0057b7)](https://stand-with-ukraine.pp.ua)\r\n\r\n**HighLevel API Part**: [LiteEntitySystem](https://github.com/RevenantX/LiteEntitySystem)\r\n\r\n**Discord chat**: [![Discord](https://img.shields.io/discord/501682175930925058.svg)](https://discord.gg/FATFPdy)\r\n\r\n[OLD BRANCH (and examples) for 0.9.x](https://github.com/RevenantX/LiteNetLib/tree/0.9)\r\n\r\n[Little Game Example on Unity](https://github.com/RevenantX/NetGameExample)\r\n\r\n[Documentation](https://revenantx.github.io/LiteNetLib/index.html)\r\n\r\n## Build\r\n\r\n### [NuGet](https://www.nuget.org/packages/LiteNetLib/) [![NuGet](https://img.shields.io/nuget/v/LiteNetLib?color=blue)](https://www.nuget.org/packages/LiteNetLib/) [![NuGet](https://img.shields.io/nuget/vpre/LiteNetLib)](https://www.nuget.org/packages/LiteNetLib/#versions-body-tab) [![NuGet](https://img.shields.io/nuget/dt/LiteNetLib)](https://www.nuget.org/packages/LiteNetLib/) \r\n\r\n### [Release builds](https://github.com/RevenantX/LiteNetLib/releases) [![GitHub (pre-)release](https://img.shields.io/github/release/RevenantX/LiteNetLib/all.svg)](https://github.com/RevenantX/LiteNetLib/releases)\r\n\r\n### [DLL build from master](https://ci.appveyor.com/project/RevenantX/litenetlib/branch/master/artifacts) [![](https://ci.appveyor.com/api/projects/status/354501wnvxs8kuh3/branch/master?svg=true)](https://ci.appveyor.com/project/RevenantX/litenetlib/branch/master)\r\n( Warning! Master branch can be unstable! )\r\n\r\n## Features\r\n\r\n* Lightweight\r\n  * Small CPU and RAM usage\r\n  * Small packet size overhead ( 1 byte for unreliable, 4 bytes for reliable packets )\r\n* Simple connection handling\r\n* Peer to peer connections\r\n* Helper classes for sending and reading messages\r\n* Multiple data channels\r\n* Different send mechanics\r\n  * Reliable with order\r\n  * Reliable without order\r\n  * Reliable sequenced (realiable only last packet)\r\n  * Ordered but unreliable with duplication prevention\r\n  * Simple UDP packets without order and reliability\r\n* Fast packet serializer [(Usage manual)](https://revenantx.github.io/LiteNetLib/articles/netserializerusage.html)\r\n* Automatic small packets merging\r\n* Automatic fragmentation of reliable packets\r\n* Automatic MTU detection\r\n* Optional CRC32C checksums\r\n* UDP NAT hole punching\r\n* NTP time requests\r\n* Packet loss and latency simulation\r\n* IPv6 support (using separate socket for performance)\r\n* Connection statisitcs\r\n* Multicasting (for discovering hosts in local network)\r\n* Unity support\r\n* Support for .NET8 optimized socket calls (much less gc)\r\n* Supported platforms:\r\n  * Windows/Mac/Linux (.NET Framework, Mono, .NET Core, .NET Standard)\r\n  * Lumin OS (Magic Leap)\r\n  * Monogame\r\n  * Godot\r\n  * Unity 2018.3 (Desktop platforms, Android, iOS, Switch)\r\n  \r\n## Support developer\r\n* [![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/revx)\r\n\r\n* USDT TRC20: `TE5eBgq8SyEeZFKtCgZG9GwL34sANmbc67`\r\n\r\n* USDT BEP20/ERC20: `0x4c0D6DC76c6A6B354f5ec6c9e51893fFC6510d1E`\r\n\r\n* Bitcoin: `bc1q269ecs8r5vnrum5qr5j98sdglhnxlulv0f6egd`\r\n\r\n## Unity notes!!!\r\n* Minimal supported Unity is 2018.3. For older Unity versions use [0.9.x library](https://github.com/RevenantX/LiteNetLib/tree/0.9) versions\r\n* Always use library sources or [OpenUPM package](https://openupm.com/packages/com.revenantx.litenetlib/) instead of precompiled DLL files ( because there are platform specific #ifdefs and workarounds for unity bugs )\r\n\r\n## Usage samples\r\n\r\n### Client\r\n```csharp\r\nEventBasedNetListener listener = new EventBasedNetListener();\r\nNetManager client = new NetManager(listener);\r\nclient.Start();\r\nclient.Connect(\"localhost\" /* host ip or name */, 9050 /* port */, \"SomeConnectionKey\" /* text key or NetDataWriter */);\r\nlistener.NetworkReceiveEvent += (fromPeer, dataReader, deliveryMethod, channel) =\u003e\r\n{\r\n    Console.WriteLine(\"We got: {0}\", dataReader.GetString(100 /* max length of string */));\r\n    dataReader.Recycle();\r\n};\r\n\r\nwhile (!Console.KeyAvailable)\r\n{\r\n    client.PollEvents();\r\n    Thread.Sleep(15);\r\n}\r\n\r\nclient.Stop();\r\n```\r\n### Server\r\n```csharp\r\nEventBasedNetListener listener = new EventBasedNetListener();\r\nNetManager server = new NetManager(listener);\r\nserver.Start(9050 /* port */);\r\n\r\nlistener.ConnectionRequestEvent += request =\u003e\r\n{\r\n    if(server.ConnectedPeersCount \u003c 10 /* max connections */)\r\n        request.AcceptIfKey(\"SomeConnectionKey\");\r\n    else\r\n        request.Reject();\r\n};\r\n\r\nlistener.PeerConnectedEvent += peer =\u003e\r\n{\r\n    Console.WriteLine(\"We got connection: {0}\", peer);  // Show peer ip\r\n    NetDataWriter writer = new NetDataWriter();         // Create writer class\r\n    writer.Put(\"Hello client!\");                        // Put some string\r\n    peer.Send(writer, DeliveryMethod.ReliableOrdered);  // Send with reliability\r\n};\r\n\r\nwhile (!Console.KeyAvailable)\r\n{\r\n    server.PollEvents();\r\n    Thread.Sleep(15);\r\n}\r\nserver.Stop();\r\n```\r\n","funding_links":["https://www.paypal.com/donate/?business=G9PDX5KLGKBA2\u0026no_recurring=0\u0026currency_code=USD","https://www.buymeacoffee.com/revx"],"categories":["Open Source Packages","NetWork","Open Source Repositories","Networks","C#","Libraries","C# #"],"sub_categories":["Networking"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRevenantX%2FLiteNetLib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRevenantX%2FLiteNetLib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRevenantX%2FLiteNetLib/lists"}