EasyTcp 2.0.4.1

A high performance tcp server and client. (Async) (IPv6 & IPv4) Simple and easy to use. See the documentation: https://github.com/GHenkje/EasyTcp/wiki

Install-Package EasyTcp -Version 2.0.4.1
dotnet add package EasyTcp --version 2.0.4.1
<PackageReference Include="EasyTcp" Version="2.0.4.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasyTcp --version 2.0.4.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

The whole documentation is to big for nuget, please see the wiki on my github.

Getting started

Use 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.

Use the namespace "EasyTcp.Client" for the EasyTcpClient class.

Use the namespace "EasyTcp.Server" for the EasyTcpServer class;

Example of a simple server which print the length of the received data:

Example of a simple server which 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 which 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)

The whole documentation is to big for nuget, please see the wiki on my github.

Getting started

Use 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.

Use the namespace "EasyTcp.Client" for the EasyTcpClient class.

Use the namespace "EasyTcp.Server" for the EasyTcpServer class;

Example of a simple server which print the length of the received data:

Example of a simple server which 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 which 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)

Release Notes

- Updated encryption class
 - Added GetKey();

  • .NETStandard 2.0

    • No dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.0.4.1 227 5/21/2019
2.0.4 159 4/11/2019
2.0.3 154 3/5/2019
2.0.2 135 2/18/2019
2.0.1 120 2/16/2019
2.0.0 136 2/15/2019