ECN>> APM>> 返回
项目作者: yswenli

项目描述 :
High performance TCP communication framework,It is very simple to use,and the general server easy connection on millions 高性能的TCP通信框架,它使用非常简单,服务器轻松连接上百万
高级语言: C#
项目地址: git://github.com/yswenli/APM.git
创建时间: 2016-12-19T08:52:15Z
项目社区:https://github.com/yswenli/APM

开源协议:Apache License 2.0

下载


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);