VOOZH about

URL: https://www.nuget.org/packages/LiteNetLib/

⇱ NuGet Gallery | LiteNetLib 2.1.4




👁 Image
LiteNetLib 2.1.4

dotnet add package LiteNetLib --version 2.1.4
 
 
NuGet\Install-Package LiteNetLib -Version 2.1.4
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LiteNetLib" Version="2.1.4" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LiteNetLib" Version="2.1.4" />
 
Directory.Packages.props
<PackageReference Include="LiteNetLib" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LiteNetLib --version 2.1.4
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LiteNetLib, 2.1.4"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LiteNetLib@2.1.4
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LiteNetLib&version=2.1.4
 
Install as a Cake Addin
#tool nuget:?package=LiteNetLib&version=2.1.4
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

LiteNetLib 2

Lite reliable UDP library for .NET Standard 2.1 (Mono, .NET)

👁 Made in Ukraine

HighLevel API Part: LiteEntitySystem

Matrix chat: Matrix

Discord chat: 👁 Discord

OLD BRANCH (and examples) for 1.x

Little Game Example on Unity

Documentation

Build

NuGet 👁 NuGet
👁 NuGet
👁 NuGet

Release builds 👁 GitHub (pre-)release

DLL build from master 👁 alternate text is missing from this package README image

( Warning! Master branch can be unstable! )

Features

  • Lightweight
    • Small CPU and RAM usage
    • Small packet size overhead ( 1 byte for unreliable, 4 bytes for reliable packets )
  • Simple connection handling
  • Peer to peer connections
  • Helper classes for sending and reading messages
  • Multiple data channels
  • Different send mechanics
    • Reliable with order
    • Reliable without order
    • Reliable sequenced (reliable only last packet)
    • Ordered but unreliable with duplication prevention
    • Simple UDP packets without order and reliability
  • Fast packet serializer (Usage manual)
  • Automatic small packets merging
  • Automatic fragmentation of reliable packets
  • Automatic MTU detection
  • Optional CRC32C checksums
  • UDP NAT hole punching
  • NTP time requests
  • Packet loss and latency simulation
  • IPv6 support (using separate socket for performance)
  • Connection statistics
  • Multicasting (for discovering hosts in local network)
  • Unity support
  • Support for .NET8 optimized socket calls (much less gc)
  • Supported platforms:
    • Windows/Mac/Linux (.NET Framework, Mono, .NET Core, .NET Standard)
    • Lumin OS (Magic Leap)
    • MonoGame
    • Godot
    • Unity 2021.2 (Desktop platforms, Android, iOS, Switch)

Support developer

  • USDT TRC20: TE5eBgq8SyEeZFKtCgZG9GwL34sANmbc67

  • USDT BEP20/ERC20: 0x4c0D6DC76c6A6B354f5ec6c9e51893fFC6510d1E

  • Bitcoin: bc1q269ecs8r5vnrum5qr5j98sdglhnxlulv0f6egd

Unity notes!!!

  • Minimal supported Unity is 2021.2. For older Unity versions use 1.x library versions
  • Always use library sources or OpenUPM package instead of precompiled DLL files ( because there are platform specific #ifdefs and workarounds for unity bugs )

Usage samples

Client

var listener = new EventBasedNetListener();
var client = new NetManager(listener);
client.Start();
client.Connect("localhost" /* host IP or name */, 9050 /* port */, "SomeConnectionKey" /* text key or NetDataWriter */);
listener.NetworkReceiveEvent += (fromPeer, dataReader, channel, deliveryMethod) =>
{
 Console.WriteLine("We got: {0}", dataReader.GetString(100 /* max length of string */));
 dataReader.Recycle();
};

while (!Console.KeyAvailable)
{
 client.PollEvents();
 Thread.Sleep(15);
}

client.Stop();

Server

var listener = new EventBasedNetListener();
var server = new NetManager(listener);
server.Start(9050 /* port */);

listener.ConnectionRequestEvent += request =>
{
 if(server.ConnectedPeersCount < 10 /* max connections */)
 request.AcceptIfKey("SomeConnectionKey");
 else
 request.Reject();
};

listener.PeerConnectedEvent += peer =>
{
 Console.WriteLine("We got connection: {0}", peer); // Show peer IP
 var writer = new NetDataWriter(); // Create writer class
 writer.Put("Hello client!"); // Put some string
 peer.Send(writer, DeliveryMethod.ReliableOrdered); // Send with reliability
};

while (!Console.KeyAvailable)
{
 server.PollEvents();
 Thread.Sleep(15);
}
server.Stop();
Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 netstandard2.1 is compatible. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (42)

Showing the top 5 NuGet packages that depend on LiteNetLib:

Package Downloads
EdenNetwork

Simple C# TCP/UDP socket server&client API for .NET & Unity

BetterTogether

A simple C# multiplayer library

Shaman.LiteNetLibAdapter

Package Description

ShareLib.Network

网络基础帮助库

CitiesSkylinesMultiplayer.API

API for Multiplayer mod for Cities: Skylines

GitHub repositories (13)

Showing the top 13 popular GitHub repositories that depend on LiteNetLib:

Repository Stars
SubnauticaNitrox/Nitrox
An open-source, multiplayer modification for the game Subnautica.
OpenSAGE/OpenSAGE
OpenSAGE is a free, open source re-implementation of SAGE, the 3D real time strategy (RTS) engine used in Command & Conquer: Generals and other RTS titles from EA Pacific. Written in C#. Not affiliated with EA.
Reloaded-Project/Reloaded-II
Universal .NET Core Powered Modding Framework for any Native Game X86, X64.
CitiesSkylinesMultiplayer/CSM
Source code for the Cities: Skylines Multiplayer mod (CSM)
rwmt/Multiplayer
Zetrith's Multiplayer mod for RimWorld
UltraStar-Deluxe/Play
Free and open source singing game with song editor for desktop and mobile
Bannerlord-Coop-Team/BannerlordCoop
RevenantX/LiteEntitySystem
Pure C# HighLevel API for multiplayer games
AvionBlock/VoiceCraft
VoiceCraft software to implement proximity VC for Minecraft Bedrock Edition
RighteousRyan1/TanksRebirth
A complete rebuild of Wii Play's Tanks game mode. Attempting to stay true to the original game.
Papela/Nitrox-Cracked-Mod
An open-source, multiplayer modification for the game Subnautica (Cracked).
boonkerz/teamscreen
It should be an Teamviewer/Vnc/Something replacement
roy-t/MiniRTS
A game engine to learn about game engine development
Version Downloads Last Updated
2.1.4 6,537 5/19/2026
2.1.3 6,177 4/18/2026
2.1.2 6,556 3/25/2026
2.1.0 1,686 3/25/2026
2.0.2 6,558 2/14/2026
2.0.1 2,710 2/2/2026
1.3.5 10,667 12/16/2025
1.3.1 69,687 11/23/2024 1.3.1 is deprecated because it has critical bugs.
1.3.0 3,183 11/22/2024 1.3.0 is deprecated because it has critical bugs.
1.2.0 62,297 1/10/2024 1.2.0 is deprecated because it has critical bugs.
1.1.0 24,475 4/24/2023 1.1.0 is deprecated because it has critical bugs.
0.9.5.2 24,918 10/14/2021
Loading failed