<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Griffin.Framework.Net 高性能網(wǎng)絡(luò)框架

          聯(lián)合創(chuàng)作 · 2023-09-29 12:38

          Griffin.Framework 是 .NET 的高性能網(wǎng)絡(luò)框架。

          示例代碼:

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

                                     

           


          瀏覽 18
          點贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  先锋影音av成人资源站 | 久操成人| 久久天堂精品 | 狠狠狠狠狠狠狠狠狠 | 久久伊人大香蕉 |