Netly 2.5.2
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Netly --version 2.5.2
NuGet\Install-Package Netly -Version 2.5.2
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.5.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Netly --version 2.5.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Netly, 2.5.2"
#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.5.2
// Install Netly as a Cake Tool
#tool nuget:?package=Netly&version=2.5.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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.
Docs
See the documentation here!
Install
Official publisher
Nuget | Unity Asset Store |
---|---|
Install on Nuget | Install on Asset Store |
Versions
Notable changes
v1 (old) | v2 (current) | v3 (nonexistent) |
---|---|---|
TCP client/server | TCP/IP Message Framing | SSL client/server |
UDP client/server | TCP/UDP performance improvement | Add documentation and samples for SSL |
Dependency
Build
# 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
List of tested platforms
Demo
messageFraming: just set this to false if you want to use netly to communicate with another tcp library.
true case: this will improve data security, but both client and server must have the same configuration.
Client
Instance
Usageusing Netly; using Netly.Core; // Example udp client instance var client = new UdpClient(); // Example tcp client instance var client = new TcpClient(messageFraming: true); // Example host instance var host = new Host("127.0.0.1", 3000);
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
Usageusing Netly; using Netly.Core; // Example tcp server instance var server = new TcpServer(messageFraming: true); // Example udp server instance var server = new UdpServer(); // Example host instance var host = new Host("0.0.0.0", 3000);
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();
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 | Versions 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
- Byter (>= 1.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
+ Update default MAX_SIZE 8kb to 8MB (Package.MAX_SIZE -> MesssageFraming encode/decode)