Skip to content
This repository has been archived by the owner on Jul 24, 2018. It is now read-only.

Latest commit

 

History

History
49 lines (40 loc) · 1.02 KB

README.md

File metadata and controls

49 lines (40 loc) · 1.02 KB

XGain Build status codecov.io

Description

XGain is simple and small TCP/IP server.

Things todo:

  • Optimize network layer to reuse bytes
  • Add retry logic using Polly

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