A simple to use TCP and UDP networking library for .NET, designed to be flexible, scalable and FAST.
- .NET Standard 2.0
- TCP
- UDP
- Socket Pooling
- Object Pooling
- Process thousands of requests per second
- Dependency Injection using Service Collection
- Works with Unity Game Engine
V3 is currently in pre-release. Get the latest build below. NuGet Package Manager
Install-Package Networker -IncludePrerelease
You must then install one of the following formatters
Networker.Formatter.ZeroFormatter
Install-Package Networker.Formatter.ZeroFormatter
Networker.Formatter.ProtoBufNet
Install-Package Networker.Formatter.ProtoBufNet
Find more information about how to get started on our Wiki or view the Examples found inside the repository.
Creating a server is easy..
var server = new ServerBuilder()
.UseTcp(1000)
.UseLogger<ConsoleLogger>()
.SetLogLevel(LogLevel.Info)
.UseZeroFormatter()
.Build();
You can handle a packet easily using dependency injection, logging and built-in deserialisation.
public class PingPacketHandler : PacketHandlerBase<PingPacket>
{
private readonly ILogger logger;
public PingPacketHandler(ILogger logger)
{
this.logger = logger;
}
public override async Task Process(PingPacket packet, ISender sender)
{
this.logger.Debug("Received a ping packet from " + sender.EndPoint);
}
}
Version 3 included a large rewrite and various breaking changes. To use V2 please see V2 Branch