Netly version 4 will be released soon, help validating the new way of interacting with netly. See more
powered by ALEC1O
Get basic information about this project called Netly
| Overview |
Netly is a powerful C# socket library that simplifies network communication. It supports HTTP, TCP, SSL/TLS, UDP and WebSocket protocols, making it ideal for building multiplayer games, chat applications, and more. |
||||
|---|---|---|---|---|---|
| Link's |
Repository: github.com/alec1o/netly Documentation: netly.docs.kezero.com |
||||
| Install |
|
||||
| Sponsor |
|
||||
| Supporter |
|
Notable changes
| 4.x.x | Development | HTTP client and server support | RUDP client and server support | WebSocket client and server | Syntax and internal improvement | Code XML comments improvement | Documentation improvement by DocFx |
|---|---|---|---|---|---|---|---|
| 3.x.x | Stable | TCP with TLS/SSL support | UDP with connection (timeout response) | New Message Framing protocol and performance increase | Update for Byter 2.0 | Docsify as documentation framework | |
| 2.x.x | Legacy | TCP with Message Framing support | TCP and UDP performance increase | ||||
| 1.x.x | Legacy | TCP support | UDP Support |
Technical descriptions about integrations
| List of tested platforms |
|
|---|---|
| Dependencies |
|
| Build |
# 1. clone project
$ git clone "https://github.com/alec1o/Netly" netly
# 2. build project
$ dotnet build "netly/" -c Release -o "netly/bin/"
# NOTE:
# Netly.dll require Byter.dll because is Netly dependency
# Netly.dll and Byter.dll have on build folder <netly-path>/bin/ |
| Features |
|
Code highlights
| TCP |
📄 Clientusing Netly;
TCP.Client client = new TCP.Client(framing: true);client.On.Open(() =>
{
printf("connection opened");
});
client.On.Close(() =>
{
printf("connetion closed");
});
client.On.Error((exception) =>
{
printf("connection erro on open");
});
client.On.Data((bytes) =>
{
printf("connection receive a raw data");
});
client.On.Event((name, data) =>
{
printf("connection receive a event");
});
client.On.Modify((socket) =>
{
printf("called before try open connection.");
});
client.On.Encryption((certificate, chain, errors) =>
{
// Only if client.IsEncrypted is enabled
printf("validate ssl/tls certificate");
// return true if certificate is valid
return true;
});// open connection if closed
client.To.Open(new Host("127.0.0.1", 8080));
// close connection if opened
client.To.Close();
// send raw data if connected
client.To.Data(new byte[2] { 128, 255 });
client.To.Data("hello world", NE.Encoding.UTF8);
// send event if connected
client.To.Event("name", new byte[2] { 128, 255 });
client.To.Event("name", "hello world", NE.Encoding.UTF8);
// enable encryption (must call before client.To.Open)
client.To.Encryption(true); 📄 Serverusing Netly;
TCP.Server server = new TCP.Server(framing: true);server.On.Open(() =>
{
printf("connection opened");
});
server.On.Close(() =>
{
printf("connection closed");
});
server.On.Error((exception) =>
{
printf("connection error on open");
});
server.On.Accept((client) =>
{
client.On.Open(() =>
{
printf("client connected");
});
client.On.Data((bytes) =>
{
printf("client receive a raw data");
});
client.On.Event((name, bytes) =>
{
printf("client receive a event");
});
client.On.Close(() =>
{
printf("client disconnected");
});
});
server.On.Modify((socket) =>
{
printf("called before try open connection.");
});// open connection
server.To.Open(new Host("1.1.1.1", 1111));
// close connection
server.To.Close();
// enable encryption support (must called before server.To.Open)
server.To.Encryption(enable: true, @mypfx, @mypfxpassword, SslProtocols.Tls12); |
|---|---|
| UDP |
📄 Clientusing Netly;
UDP.Client client = new UDP.Client(useConnection: true, timeout: 15000);client.On.Open(() =>
{
printf("connection opened");
});
client.On.Close(() =>
{
printf("connection closed");
});
client.On.Error((exception) =>
{
printf("connection error on open");
});
client.On.Data((bytes) =>
{
printf("connection received a raw data");
});
client.On.Event((name, eventBytes) =>
{
printf("connection received a event");
});
client.On.Modify((socket) =>
{
printf("called before try open connection.");
});// open connection if closed
client.To.Open(new Host("127.0.0.1", 8080));
// close connection if opened
client.To.Close();
// send raw data if connected
client.To.Data(new byte[2] { 128, 255 });
client.To.Data("hello world", NE.Encoding.UTF8);
// send event if connected
client.To.Event("name", new byte[2] { 128, 255 });
client.To.Event("name", "hello world", NE.Encoding.UTF8); 📄 Serverusing Netly;
UDP.Server server = new UDP.Server(useConnection: true, timeout: 15000);server.On.Open(() =>
{
printf("connection opened");
});
server.On.Close(() =>
{
printf("connection closed");
});
server.On.Error((exception) =>
{
printf("connection error on open");
});
server.On.Accept((client) =>
{
client.On.Open(() =>
{
printf("client connected");
});
client.On.Close(() =>
{
// Only if use connection is enabled.
printf("client disconnected");
});
client.On.Data((bytes) =>
{
printf("client received a raw data");
});
client.On.Event((name, bytes) =>
{
printf("client received a event");
});
});// open connection
server.To.Open(new Host("127.0.0.1", 8080));
// close connection
server.To.Close(); |
| HTTP |
📄 Client📄 Server |
| RUDP |
📄 Client📄 Server |
| WebSocket |
📄 Client📄 Server |
Integration and interaction example codes


