EasyTcp 2.0.2
See the version list below for details.
dotnet add package EasyTcp --version 2.0.2
NuGet\Install-Package EasyTcp -Version 2.0.2
<PackageReference Include="EasyTcp" Version="2.0.2" />
paket add EasyTcp --version 2.0.2
#r "nuget: EasyTcp, 2.0.2"
// Install EasyTcp as a Cake Addin
#addin nuget:?package=EasyTcp&version=2.0.2
// Install EasyTcp as a Cake Tool
#tool nuget:?package=EasyTcp&version=2.0.2
The whole documentation is to big for nuget, please see the wiki on my github.
Getting started
Add the namespace "EasyTcp" for the Message and Encryption class. The message class is used by the event handler DataReceived. The Encryption class is used when working with encryption.
Add the namespace "EasyTcp.Client" for the EasyTcpClient class.
Add the namespace "EasyTcp.Server" for the EasyTcpServer class;
Example of a simple server wich print the length of the received data:
using System;
using EasyTcp;
using EasyTcp.Server;
namespace EasyTcpExampleServer
{
class Program
{
static void Main(string[] args)
{
EasyTcpServer Server = new EasyTcpServer();
/* Start a server:
* IP: IPAddress.Any(IPv4)
* Port: 999
* MaxConnections: 1000
*/
Server.Start(System.Net.IPAddress.Any,999,1000);
Server.DataReceived += DataReceived;//Set event for DataReceived.
System.Threading.Tasks.Task.Delay(-1).Wait();//Don't exit the console.
}
private static void DataReceived(object sender, Message e)
{
Console.WriteLine($"Received: {e.Data.Length} bytes");
}
}
}
Example of a simple client wich send to the server: "Hey server"
using System;
using EasyTcp;
using EasyTcp.Client;
namespace EasyTcpExampleClient
{
class Program
{
static void Main(string[] args)
{
EasyTcpClient Client = new EasyTcpClient();
/*Connect to server:
* IP: 127.0.0.1(IPv4)
* Port: 999
* Timeout: 1 second
*/
bool Connected = Client.Connect("127.0.0.1",999,TimeSpan.FromSeconds(1));
if(!Connected)
{
Console.WriteLine("Could not connect to server");
Console.ReadKey();
return;
}
Client.Send("Hey server");
System.Threading.Tasks.Task.Delay(-1).Wait();//Don't exit the console.
}
}
}
More advanced (Click)
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. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on EasyTcp:
Package | Downloads |
---|---|
EasyTcp.Actions
Support for EasyTcp to triggering specific functions with an attribute based on received data. See github for examples. |
|
EasyTcp.Encryption
Ssl support for EasyTcp and EasyTcp.Actions |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on EasyTcp:
Repository | Stars |
---|---|
Job79/EasyTcp
TCP framework for C#. Focused on usability and performance.
|
- Changed data tag to ushort.
- Changed MaxDataSize to ushort.