XGain is simple and small TCP/IP server.
Things todo:
- Optimize network layer to reuse bytes
- Add retry logic using Polly
var message = new byte[1024];
var client = new XGainClient(address, port);
await client.SendAsync(message);
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();
}
MIT