探索flutter框架开发的app在移动应用市场的潜力与挑战
586
2022-10-20
Griffin.Framework- .Net 高性能网络框架
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")); }}
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~