LiteNetLib 1.2.0

dotnet add package LiteNetLib --version 1.2.0                
NuGet\Install-Package LiteNetLib -Version 1.2.0                
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="1.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LiteNetLib --version 1.2.0                
#r "nuget: LiteNetLib, 1.2.0"                
#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.
// Install LiteNetLib as a Cake Addin
#addin nuget:?package=LiteNetLib&version=1.2.0

// Install LiteNetLib as a Cake Tool
#tool nuget:?package=LiteNetLib&version=1.2.0                


Lite reliable UDP library for .NET Standard 2.0 (Mono, .NET Core, .NET Framework)

Made in Ukraine

HighLevel API Part: LiteEntitySystem

Discord chat: Discord

OLD BRANCH (and examples) for 0.9.x

Little Game Example on Unity



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! )


  • 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 (realiable 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 statisitcs
  • 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 2018.3 (Desktop platforms, Android, iOS, Switch)

Support developer

"Buy Me A Coffee"

Unity notes!!!

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

Usage samples


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

while (!Console.KeyAvailable)



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

listener.ConnectionRequestEvent += request =>
    if(server.ConnectedPeersCount < 10 /* max connections */)

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

while (!Console.KeyAvailable)
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 is compatible.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 4.7.1

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.
  • net5.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (24)

Showing the top 5 NuGet packages that depend on LiteNetLib:

Package Downloads

Tungsten is a C# library of classes to make application development easier


Package Description


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


Package Description


Package Description

GitHub repositories (10)

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

Repository Stars
An open-source, multiplayer modification for the game Subnautica.
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.
Source code for the Cities: Skylines Multiplayer mod (CSM)
Universal .NET Core Powered Modding Framework for any Native Game X86, X64.
Zetrith's Multiplayer mod for RimWorld
Version Downloads Last updated
1.2.0 7,662 1/10/2024
1.1.0 11,786 4/24/2023 19,582 10/14/2021 34,128 3/13/2019