.Net开源的高性能网络框架 Griffin.Framework.zip
Griffin.Framework 是 .NET 的高性能网络框架。示例代码:public class Server{ private readonly ChannelTcpListener _server; public Server() { _server = new ChannelTcpListener(); _server.MessageReceived = OnMessage; _server.ClientConnected = OnClientConnected; _server.ClientDisconnected = OnClientDisconnected; } public int LocalPort { get { return _server.LocalPort; } } public void Start() { _server.Start(IPAddress.Any, 0); } private void OnClientConnected(object sender, ClientConnectedEventArgs e) { Console.WriteLine("Got connection from client with ip " e.channel.RemoteEndPoint); } private void OnClientDisconnected(object sender, ClientDisconnectedEventArgs e) { Console.WriteLine("Disconnected: " e.Channel.RemoteEndpoint); } private void OnMessage(ITcpChannel channel, object message) { Console.WriteLine("Server received: " message); channel.Send(Encoding.ASCII.GetBytes("Hello world")); }} 标签:网络框架
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 粉丝: 436
- 资源: 1万+
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助