Git Product home page Git Product logo

apm's Introduction

APM

High performance TCP communication framework,It is very simple to use,and the general server easy connection on millions ;message forwarding support for publish/subscribe、private model.

高性能的TCP通信框架,它使用非常简单,轻松连接上百万;消息转发方式支持发布/订阅、私信模式。

Server Example:

Console.Title = "Server";

Console.WriteLine("server test");

server = new Server(8889, 500);

server.OnAccepted += Server_OnAccepted;

server.OnMessage += Server_OnReceived;

server.OnDisConnected += Server_OnDisConnected;

server.OnOnError += Server_OnOnError;

server.Start();

Console.WriteLine("server is running...");

Client Example:

Console.WriteLine("Client send test");

var client = new Client(Guid.NewGuid().ToString("N"), 10, localIP);

client.OnConnected += Client_OnConnected;

client.OnMessage += Client_OnMessage;

client.OnDisConnected += Client_OnDisConnected;

client.OnError += Client_OnError;

client.Connect();

Server send message

server.SendMsg(remote, "server:hello   " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));

Server send file

server.SendFile(UserToken remote, string fileName);

Client send message

client.SendMsg("client:hello   " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));

Client send file

client.sendFile(string fileName);

apm's People

Contributors

yswenli avatar

Watchers

James Cloos avatar  avatar

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.