Releases: RevenantX/LiteNetLib
LiteNetLib 2.0
What's Changed
-
Set C# language version to 8 and minimal .net version to netstandard2.1
-
Add simplified and faster
LiteNetManagerwithLiteNetPeerwhich has 1reliable-orderedchannel, 1reliable-unordered, 1sequencedchannel (andunreliablechannel) which is enough for many cases.ReliableSequencedchannel is same asreliable-orderedinLiteNetPeer(where oldNetManagercan have more than 1 channel perDeliveryMethodas before and fully supportReliableSequencedchannels for very specific use-cases) -
Ntp requests now only supported in full
NetManager -
Merge additional listener interfaces into INetEventListener with default empty implementation. Merged methods:
OnMessageDeliveredOnNtpResponseOnPeerAddressChanged
-
Add reliable packet merging which drastically increase speed of
ReliableOrderedandReliableUnorderedchannels when sending many small packets -
Fix .net8 receive bug #552
-
Add Configurable Resend packet delay for reliable packets (#567)
-
Remove not threadsafe
ConnectedPeerList. AddGetConnectedPeersinstead. Fix #584 -
Increment packet loss in reliable channel only when there is pending packets. Fix #564
-
Optimizations and some additional protections
-
Simplify code using Spans and remove old #ifdefs for older .net versions
Full Changelog: 1.3.5...2.0.0
LiteNetLib 1.3.5
What's Changed
- Fixed typos in readme by @AldeRoberge in #576
- Fix NativeAddress update bug in FinishEndPointChange method by @Niaobu in #578
- Support for connecting and writing span of bytes by @popcron in #577
- Feature: Allow simulating outbound networking by @Niaobu in #579
- Add incoming fragments limit
- Prevent unnecessary allocations in
NetManager.ProcessNtpRequests - Drop net471 in nuget packet (but it will work from source)
- Some little additions to NetDataWriter/NetDataReader
New Contributors
- @AldeRoberge made their first contribution in #576
- @Niaobu made their first contribution in #578
Full Changelog: 1.3.1...1.3.5
LiteNetLib 1.3.1
Changes in 1.3.1
- Fix crash when sending Merged byte without data
- Add .net8 and .net7 targets (and nuget variants) to support specific features
- Remove .net5 target because EOL. You can use .NET Standard for .net5.
Changes in 1.3.0
- Stop running NetManagers in Unity in OnApplicationQuit (when using library source code)
- Disable MTU discovery by default because some routers can break detection and connection in result. Remove
UseSafeMtu(for this just useMtuOverride). To enable MTU discovery setNetManager.MtuDiscoverytotrue - Add optional argument max processed events into
PollEventsandManualReceive(fix #528) - Add methods to serialize and deserialize array of nested
INetSerializableintoNetDataReader/Writer - Add
GUIDserialization toNetDataWriter/ReaderandNetSerializer/NetPacketProcessor - Add
SendUnconnectedMessagewithReadOnlySpanargument - Add
NetDataWriter.AsReadOnlySpan() - Add
GetRemainingBytesMemorymethod toNetDataReader.(fix #560) - Make PeerTimers and ElapsedMilliseconds as float (fix #521)
- Improve
NetDataWriter/Readerstrings. - Add
PutLargeString(with int size) andGetLargeStringintoNetDataWriter/Reader - Fix
ObjectDisposedExceptionwith Native Sockets (fix #542) - Lock unreliable channel only if there is pending packets
- Unreliable packets optimization
For installation in typical .NET project use nuget package
For Unity use sources zip and copy directory LiteNetLib to your project
LiteNetLib 1.3.0
- Stop running NetManagers in Unity in OnApplicationQuit (when using library source code)
- Disable MTU discovery by default because some routers can break detection and connection in result. Remove
UseSafeMtu(for this just useMtuOverride). To enable MTU discovery setNetManager.MtuDiscoverytotrue - Add optional argument max processed events into
PollEventsandManualReceive(fix #528) - Add methods to serialize and deserialize array of nested
INetSerializableintoNetDataReader/Writer - Add
GUIDserialization toNetDataWriter/ReaderandNetSerializer/NetPacketProcessor - Add
SendUnconnectedMessagewithReadOnlySpanargument - Add
NetDataWriter.AsReadOnlySpan() - Add
GetRemainingBytesMemorymethod toNetDataReader.(fix #560) - Make PeerTimers and ElapsedMilliseconds as float (fix #521)
- Improve
NetDataWriter/Readerstrings. - Add
PutLargeString(with int size) andGetLargeStringintoNetDataWriter/Reader - Fix
ObjectDisposedExceptionwith Native Sockets (fix #542) - Lock unreliable channel only if there is pending packets
- Unreliable packets optimization
For installation in typical .NET project use nuget package
For Unity use sources zip and copy directory LiteNetLib to your project
LiteNetLib 1.2.0
- Derive NetPeer from IPEndPoint (so to get EndPoint of peer you just use peer instead of peer.RemoteEndPoint)
- Add .NET8+ garbage less
Socket.Send/Socket.Receive - Add .NET5+ Member Trimming Annotations
- Add
NetDataReader.Get(out ...)methods - Add
NetManager.SendToAllwithReadOnlySpan - Add
NetDataReader.GetRemainingBytesSpan() - Add optional
NetManager.DontRouteoption for sockets (for specific cases) - Sort Network Interfaces to prefer Wifi over Cellular (local ip)
- Process shutdown error (for specific cases)
- Fix
AllowPeerAddressChangeworks only if you implementIPeerAddressChangedListener(now it works without implementing) - Better protections for broken data (fixes some critical cases that can "crash" server)
- Overall optimizations
For installation in typical .NET project use nuget package
For Unity use sources zip and copy directory LiteNetLib to your project
LiteNetLib 1.1.0
- Use old behaviour of reading empty strings from
NetDataReader(string.Emptyinsteadnullas in 0.9.5.2) - Reverted channels code to 0.9.5.2 (change
ConcurrentQueuethat spawns garbage back toQueue) - Don't get from pool packets bigger than
MaxSinglePacketSize(0.9.5.2 behaviour) - Remove dual mode support (because it slower than separate sockets, also doesn't work on some platforms including OSX).
- Use one thread for both sockets IPv4 and IPv6.
- Replace event queue by linked list type of queue. Fixes possible multithreaded bugs
- Update documents to netstandard2.1
PausedSocketFix(iOS unity) improved
For installation in typical .NET project use nuget package
For Unity use sources zip and copy directory LiteNetLib to your project
LiteNetLib 1.0.1.1
- Experimental
NetManager.UseNativeSocketsmode that reduces GC of .NET sockets and improves performance especially for "server" usage. - Add PooledPackets for faster
Sendcalls without copyCreatePacketFromPool(DeliveryMethod deliveryMethod, byte channelNumber)SendPooledPacket(PooledPacket packet, int userDataSize) - Add channel to the
OnNetworkReceiveevent - Add
NetPeer.RemoteIdthat represents peer id assigned on remote side (typically server) that can be used as Server Peer Id. - Add
.asmdeffor Unity - Add
ReadOnlySpan<byte>send - Add
AllowPeerAddressChangeoption (false by default) that allows clients to change Endpoint when switching from 4G to Wifi or something similar - Add
TryGetPeerByIdhelper method - Add
NetDataWriter.EnsureFitmethod to resize internal array if data not fits - Add
RoundTripTimeto peer (ping is RTT/2 leaved for compatibility with old code) - Add NetworkReset (WSAENETRESET - 10052) to ignored errors which fixes some disconnection cases
- Remove
NetDataWriterfromNetPacketProcessorto avoid multithreading "issues". AddGet<T>toNetDataReaderfor structs and separate method for classes with constructor argument to avoidActivator.CreateInstanceslow call - Correctly check new MTU when using extra package layer
- Update minimal .net version to 4.6 (C# 7.3). Minimal supported Unity version now is 2018.3
- Increased overall performance. Less copies, less "virtual" calls, other things
For installation in typical .NET project use nuget package
For Unity use sources zip and copy directory LiteNetLib to your project
LiteNetLib 0.9.5.2
- Fix offset in SendInternal for fragmented packets
- Optimize resolve address
- Optimize NetPacketProcessor hashing
- Fix generic types registration in NetPacketProcessor
- Added DisconnectOnUnreachable (now by default false) option to disable auto disconnect if NetworkUnreachable or HostUnreachable errors got
For installation in typical .NET project use nuget package
For Unity use sources zip and copy directory LiteNetLib to your project
LiteNetLib 0.9.5.1
(changes since 0.9.5)
- Fixed source compilation in unity
(changes since 0.9.4)
- Fixed packet double get from pool (changed lockfree to locks like in 0.8 because of ABA problem, but in a bit better way). This should fix some strange crashes
- Added manual mode without threads for single-threaded servers
- Added [IgnoreDataMember] attribute to NetSerializer
- Added SetPosition to NetDataWriter
- Added MTU override option
- Major performance optimization when using multiple channels (#411)
- Better internal packet recycling (less gc trash)
- Increased default MTU to 1024 (from 576)
- Moved NTP code to NetManager
- Optimized receiving speed (1 copy less)
- Fix MTU size when layer enabled
- Fix LastProperty check
- Fix merged packets verification
For installation in typical .NET project use nuget package
For Unity use sources zip and copy directory LiteNetLib to your project
LiteNetLib 0.9.5
- Fixed packet double get from pool (changed lockfree to locks like in 0.8 because of ABA problem, but in a bit better way). This should fix some strange crashes
- Added manual mode without threads for single-threaded servers
- Added [IgnoreDataMember] attribute to NetSerializer
- Added SetPosition to NetDataWriter
- Added MTU override option
- Major performance optimization when using multiple channels (#411)
- Better internal packet recycling (less gc trash)
- Increased default MTU to 1024 (from 576)
- Moved NTP code to NetManager
- Optimized receiving speed (1 copy less)
- Fix MTU size when layer enabled
- Fix LastProperty check
- Fix merged packets verification
For installation in typical .NET project use nuget package
For Unity use sources zip and copy directory LiteNetLib to your project