EasyTcp 2.0.0

A high performance/async tcp server and client. (SocketBased) (Supports IPv6 & IPv4)
Simple and easy to use(but also advanced) and has a good documentation.

There is a newer version of this package available.
See the version list below for details.
Install-Package EasyTcp -Version 2.0.0
dotnet add package EasyTcp --version 2.0.0
<PackageReference Include="EasyTcp" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasyTcp --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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");        
        }
    }
}

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");        
        }
    }
}

  • .NETCoreApp 2.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on EasyTcp:

Package Downloads
EasyTcp.Encryption
Ssl support for EasyTcp and EasyTcp.Actions
EasyTcp.Actions
Support for EasyTcp to triggering specific functions based on received data. See github for examples.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
4.0.0-beta 176 1/1/2021
3.7.8 440 10/1/2020
3.7.7 102 9/24/2020
3.6.7 98 9/21/2020
3.6.5 326 8/13/2020
3.6.4 178 8/13/2020
3.6.3 279 7/16/2020
3.6.0 250 7/4/2020
3.5.0 212 6/30/2020
3.4.0 168 6/29/2020
3.3.1 179 6/26/2020
3.3.0 192 6/26/2020
3.2.0 171 6/25/2020
3.1.0 228 5/30/2020
3.0.0 236 5/20/2020
3.0.0-rc 128 4/30/2020
2.0.4.2 655 9/28/2019
2.0.4.1 489 5/21/2019
2.0.4 319 4/11/2019
2.0.3 292 3/5/2019
2.0.2 274 2/18/2019
2.0.1 258 2/16/2019
2.0.0 289 2/15/2019
Show less