lukasz-pyrzyk / XGain

TCP/IP server based on the top of TcpListener and TPL
Other
7 stars 1 forks source link

XGain Build status codecov.io

Description

XGain is simple and small TCP/IP server.

Things todo:

Starting the client

var message = new byte[1024];
var client = new XGainClient(address, port);
await client.SendAsync(message);

Starting the server

var server = new XGainServer(address, port);

server.OnNewMessage += (sender, args) =>
{
    YourInternalProcessingMethod(args);
};

server.OnStart += (sender, args) =>
{
    LogInformationAboutStartup(args);
};

server.OnError += (sender, args) =>
{
    LogInformationAboutError(args);
}

try
{
    server.Start();
    // sleep, return or delay dispose in finally block
}
finally
{
    server.Dispose();   
}

License

MIT