Giter Site home page Giter Site logo

xgain's Introduction

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

xgain's People

Contributors

lukasz-pyrzyk avatar

Stargazers

 avatar  avatar Álvaro Rodríguez avatar  avatar Thodoris Elissaios avatar Junsung Ko avatar  avatar

Watchers

James Cloos avatar  avatar  avatar Wayne avatar

Forkers

zzona-dummies

xgain's Issues

Unable to Use Latest version of .netcore

Is there any way you could remove the Experimental reference from the NuGet package?

" Unable to resolve 'System.Buffers.Experimental (>= 0.1.0-e160527-1)' for '.NETCoreApp,Version=v1.0'."

Support for full .NET Framework

https://github.com/warden-stack/Warden/blob/master/src/Warden/project.json

"frameworks": {
    "net461": {}, 
    "netstandard1.6": {
      "imports": [
        "dotnet5.6",
        "dnxcore50"
      ],
      "dependencies": {
        "Microsoft.CSharp": "4.0.1",
        "System.Collections": "4.0.11",
        "System.Linq": "4.1.0",
        "System.Runtime": "4.1.0",
        "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
        "System.Runtime.InteropServices.RuntimeInformation": "4.0.0",
        "System.Threading": "4.0.11",
        "System.Console": "4.0.0",
        "System.Diagnostics.Process": "4.1.0"
      }
    }
  },

Improve build scripts

Right now we have collection of project to build. It should be replaced with
dotnet build \\project.json

how to use XGain

I use master branch and create copy the code.

using(IServer server = new XGainServer(IPAddress.Any, 5000, () => new SocketProcessor()) { server.OnNewMessage += (sender, message) => {} // assign your method Task worker = server.Start(); worker.Wait(); }

but is error, and miss SocketProcessor, how to use XGain ? can you give me a sample ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.