EasyTcp 2.0.0
See the version list below for details.
dotnet add package EasyTcp --version 2.0.0
NuGet\Install-Package EasyTcp -Version 2.0.0
<PackageReference Include="EasyTcp" Version="2.0.0" />
paket add EasyTcp --version 2.0.0
#r "nuget: EasyTcp, 2.0.0"
// Install EasyTcp as a Cake Addin
#addin nuget:?package=EasyTcp&version=2.0.0
// Install EasyTcp as a Cake Tool
#tool nuget:?package=EasyTcp&version=2.0.0
Welcome to the EasyTcp documentation! I am working hard on te documentation, please wait for the more advanced stuff.
First download the nuget package.
Getting started
Add using EasyTcp;
for the Message and Encryption class. The message class is used by the event handler DataReceived.
Add using EasyTcp.Client;
for the EasyTcpClient class.
Add using 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);//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");
}
}
}
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 is compatible. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
-
.NETCoreApp 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.
|