Echo.Server 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Echo.Server --version 1.0.0                
NuGet\Install-Package Echo.Server -Version 1.0.0                
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="Echo.Server" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Echo.Server --version 1.0.0                
#r "nuget: Echo.Server, 1.0.0"                
#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 Echo.Server as a Cake Addin
#addin nuget:?package=Echo.Server&version=1.0.0

// Install Echo.Server as a Cake Tool
#tool nuget:?package=Echo.Server&version=1.0.0                

Echo Server

Echo Server is a server

Installation

Echo Server is a TCP server for sending and receiving objects synchronously.

Usage


using Echo.Server;

namespace EchoTest
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create server
            EchoServer<Question, Reply> server = new EchoServer<Question, Reply>(IPAddress.Parse("127.0.0.1"), 8888);
            // Bind event (message from client)
            server.OnMessage = OnServerMessage;
            // Start the server
            server.Start();

            Console.Write("Press any key to stop the server");
            // Shutdown server
            server.Close();
            Console.ReadKey();
        }

        private static Reply OnServerMessage(ClientInfo clientInfo, Question question)
        {
            Reply reply = new Reply();
            reply.Answer = $"{question.Ask} => Fine!";
            return reply;
        }
    }
}

namespace Common
{
    [Serializable]
    public class Question
    {
        public string Ask { get; set; }
    }
    [Serializable]
    public class Reply
    {
        public string Answer { get; set; }
    }
}

Contributing

Please make sure to update tests as appropriate.

License

MIT

Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.0.0 322 9/27/2021
3.0.0 266 9/27/2021
2.0.0 275 9/27/2021
1.0.0 282 9/27/2021

Improve memory usage