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

TCP/IP server based on the top of TcpListener and TPL

License

Notifications You must be signed in to change notification settings

lukasz-pyrzyk/XGain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

TCP/IP server based on the top of TcpListener and TPL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published