Netly 2.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Netly --version 2.1.0
NuGet\Install-Package Netly -Version 2.1.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="Netly" Version="2.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Netly --version 2.1.0
#r "nuget: Netly, 2.1.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 Netly as a Cake Addin
#addin nuget:?package=Netly&version=2.1.0

// Install Netly as a Cake Tool
#tool nuget:?package=Netly&version=2.1.0

<h1 align="center"><a href="https://github.com/alec1o/netly">Netly</a></h1>

<h6 align="end"> <a href="https://netly.docs.kezero.com">Docs</a> -
<a href="mailto://support@kezero.com">Support</a> - <a href="LICENSE.md">License</a>
</h6>

<h6 align="center"> powered by <a href="https://github.com/alec1o">ALEC1O</a> </h6>

<h6 align="center"> <img align="center" src="content/logo/netly-logo-3.png" width="128px"> <h6>

About

Netly is a open source socket library for c# (C-Sharp). It facilitates the use of socket (UDP and TCP, Client and Server) with which it is compatible (Android, iOS, macOS, Linux, Windows, ...) as long as it is compiled with its destination.

<br>

Docs

See the documentation here!

<br>

Versions

Notable changes
v1 (old) v2 (current) v3 (nonexistent)
<h5>TCP client/server</h5> TCP/IP Message Framing SSL client/server
<h5>UDP client/server</h5> TCP/UDP performance improvement Add documentation and samples for SSL

<br>

Dependency

<br>

Build

  • Build dependencies

    Git
    MONO or .NET
  • Build step-by-step

# 1. clone repository 
$ git clone "https://github.com/alec1o/netly.git"

# 2. open source directory 
$ cd netly/

# 5. restore dotnet project
$ dotnet restore

# 6. build dotnet project
$ dotnet build

<br>

List of tested platforms

<br>

Demo

  • Client

    Instance
    using Netly;
    using Netly.Core;
    
    // Example udp client instance
    var client = new UdpClient();
    
    // Example tcp client instance
    var client = new TcpClient();
    
    // Example host instance
    var host = new Host("127.0.0.1", 3000);    
    
    Usage
    client.OnOpen(() =>
    {
        // connection opened
    });
    
    client.OnClose(() =>
    {
        // connection closed
    });
    
    client.OnError((exception) =>
    {   
        // error on open connection
    });
    
    client.OnData((data) => 
    {
        // buffer/data received
    });
    
    client.OnEvent((name, data) =>
    {
        // event received: {name: event name} {data: buffer/data received} 
    });
    
    // open connection
    client.Open(host);
    
    // send data
    client.ToData(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9});
    
    // send event
    client.ToEvent("name", new byte[] { 1, 2, 3, 4, 5, 6});
    
    // close connection
    client.Close();
    
  • Server

    Instance
    using Netly;
    using Netly.Core;
    
    // Example tcp server instance
    var server = new TcpServer();
    
    // Example udp server instance
    var server = new UdpServer();
    
    // Example host instance
    var host = new Host("0.0.0.0", 3000);
    
    Usage
    server.OnOpen(() =>
    {
        // connection opened: server start listen client
    });
    
    server.OnClose(() =>
    {
        // connection closed: server stop listen client
    });
    
    server.OnError((exception) =>
    {
        // error on open connection
    });
    
    server.OnEnter((client) =>
    {
        // client connected: connection accepted
    });
    
    server.OnExit((client) =>
    {
        // client disconnected: connection closed
    });
    
    server.OnData((client, data) =>
    {
        // buffer/data received: {client: client instance} {data: buffer/data received} 
    });
    
    server.OnEvent((client, name, data) =>
    {
        // event received: {client: client instance} {name: event name} {data: buffer received} 
    });
    
    // open connection
    server.Open(host);
    
    // broadcast data to clients
    server.ToData(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9});
    
    // broadcast event to clients
    server.ToEvent("name", new byte[] { 1, 2, 3, 4, 5, 6});
    
    // close connection
    server.Close();
    

<br>

Currently missing feature

Below are some missing features that are planned to be added in later versions.

  • [SslClient and SslServer] Tcp protocol with SSL/TLS encryption.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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 was computed.  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 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  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.
  • .NETStandard 2.0

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.1.0 246 10/9/2023
3.0.0 145 10/7/2023
2.5.2 180 6/30/2023
2.5.1 142 6/30/2023
2.4.0 240 3/26/2023
2.3.0 225 3/17/2023
2.2.0 203 3/16/2023
2.1.1 233 3/5/2023
2.1.0 222 3/5/2023
2.0.0 244 2/26/2023

+ Fix. MainThread error
+ Add. Byter v1.1.0