Skip to content

mkyprice/EzNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EzNet

An easy to use networking library

EzNet is a simple to use networking library

🚧 Warning Proceed at your own risk. This is an in-development library so it will change a lot. I'll try to keep the master branch stable, but expect many breaking changes.

Features

  • Async Sending/Receiving
  • Easy to swap Transport layer
  • Minimal allocations
  • Define functions to handle your packet types
  • Define function to handle your request functions

Usage

// Create a tcp server
using Server server = ConnectionFactory.BuildServer(endpoint, true);
// Create a tcp connection
using Connection client = ConnectionFactory.BuildClient(endpoint, true);
// Register our response function for all MyPacket types
server.RegisterResponseHandler<ResponsePacket, RequestPacket>((p) => 
{
    return new ResponsePacket(p.A + p.B);
});
// Send a packet that expects a response
ResponsePacket result = connection.SendAsync<ResponsePacket>(new RequestPacket(1, 2));

Dependancies

EzNet has no external dependancies It targets netstandard2.0 and net461 and uses C#8

About

Simple C# networking library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages