lith пре 4 година
родитељ
комит
cbc5b42fa5

+ 259 - 0
dotnet/Library/Sers/Sers.CL/Socket/Sers.CL.Socket.Iocp/Mode/SpinWait/DeliveryClient.cs

@@ -0,0 +1,259 @@
+// https://freshflower.iteye.com/blog/2285286
+
+using System;
+using System.Net;
+using System.Net.Sockets;
+using System.Runtime.CompilerServices;
+using System.Threading;
+using Sers.CL.Socket.Iocp.Mode.Timer;
+using Sers.Core.CL.MessageDelivery;
+using Vit.Core.Module.Log;
+using Vit.Core.Util.Net;
+using Vit.Core.Util.Pool;
+using Vit.Core.Util.Threading;
+
+namespace Sers.CL.Socket.Iocp.Mode.SpinWait
+{
+    public class DeliveryClient : IDeliveryClient
+    {
+
+
+        DeliveryConnection _conn = new DeliveryConnection();
+        public IDeliveryConnection conn => _conn;
+
+
+        public Action<IDeliveryConnection, ArraySegment<byte>> Conn_OnGetFrame { set { _conn.OnGetFrame = value; } }
+
+
+        public Action<IDeliveryConnection> Conn_OnDisconnected { set => _conn.Conn_OnDisconnected = value; }
+
+
+
+
+
+        /// <summary>
+        ///  服务端 host地址(默认 "127.0.0.1" )。例如: "127.0.0.1"、"sers.cloud"。
+        /// </summary>
+        public string host = "127.0.0.1";
+        /// <summary>
+        /// 服务端 监听端口号(默认4501)。例如: 4501。
+        /// </summary>
+        public int port = 4501;
+
+
+        /// <summary>
+        /// 接收缓存区大小
+        /// </summary>
+        public int receiveBufferSize = 8 * 1024;
+
+
+        public DeliveryClient()
+        {
+
+            _conn.receiveEventArgs = receiveEventArgs = new SocketAsyncEventArgs();
+
+            receiveEventArgs.Completed += new EventHandler<SocketAsyncEventArgs>(IO_Completed);
+
+        }
+
+
+
+
+
+
+        #region Connect Close
+
+
+
+        public bool Connect()
+        {
+            try
+            {
+                Logger.Info("[CL.DeliveryClient] Socket.Iocp,connecting... host:" + host + " port:" + port);
+
+                //(x.1) Instantiates the endpoint and socket.
+                var hostEndPoint = new IPEndPoint(NetHelp.ParseToIPAddress(host), port);
+                socket = new global::System.Net.Sockets.Socket(hostEndPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
+
+
+                _conn.Init(socket);
+
+                var buff = DataPool.BytesGet(receiveBufferSize);
+                _conn.receiveEventArgs.SetBuffer(buff, 0, buff.Length);
+
+
+                //(x.2)
+                SocketAsyncEventArgs connectArgs = new SocketAsyncEventArgs();
+                connectArgs.RemoteEndPoint = hostEndPoint;
+                connectArgs.Completed += new EventHandler<SocketAsyncEventArgs>(OnConnect);
+
+                autoResetEvent_OnConnected.Reset();
+                socket.ConnectAsync(connectArgs);
+
+
+                //(x.3) 阻塞. 让程序在这里等待,直到连接响应后再返回连接结果
+                if (!autoResetEvent_OnConnected.WaitOne(10000))
+                    return false;
+
+                if (connectArgs.SocketError != SocketError.Success)
+                {
+                    return false;
+                }
+
+
+
+                //(x.4)   
+                Send_task.threadCount = 1;
+                Send_task.action = Send_Flush;
+                Send_task.Start();
+
+
+
+
+                Logger.Info("[CL.DeliveryClient] Socket.Iocp,connected.");
+                return true;
+
+            }
+            catch (Exception ex)
+            {
+                Logger.Error(ex);
+            }
+            return false;
+        }
+
+
+        public void Close()
+        {
+            Send_task.Stop();
+
+            if (null == _conn) return;
+            var conn = _conn;
+            _conn = null;
+            conn.Close();
+        }
+        #endregion
+
+
+
+        #region Iocp
+
+
+        readonly SocketAsyncEventArgs receiveEventArgs;
+
+
+        private global::System.Net.Sockets.Socket socket = null;
+
+
+        // Signals a connection.
+        private AutoResetEvent autoResetEvent_OnConnected = new AutoResetEvent(false);
+
+
+        // Calback for connect operation
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        private void OnConnect(object sender, SocketAsyncEventArgs e)
+        {
+            // Signals the end of connection.
+            autoResetEvent_OnConnected.Set(); //释放阻塞.
+
+            //如果连接成功,则初始化socketAsyncEventArgs
+            if (e.SocketError == SocketError.Success)
+            {
+                //启动接收,不管有没有,一定得启动.否则有数据来了也不知道.
+                if (!socket.ReceiveAsync(receiveEventArgs))
+                    ProcessReceive(receiveEventArgs);
+            }
+            else
+            {
+                Close();
+            }
+
+        }
+
+
+
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        void IO_Completed(object sender, SocketAsyncEventArgs e)
+        {
+            // determine which type of operation just completed and call the associated handler
+            switch (e.LastOperation)
+            {
+                case SocketAsyncOperation.Receive:
+                    ProcessReceive(e);
+                    break;
+                case SocketAsyncOperation.Send:
+                    Logger.Info("[Iocp]IO_Completed Send");
+                    return;
+
+                //ProcessSend(e);
+                //break;
+                default:
+                    Logger.Info("[Iocp]IO_Completed default");
+                    throw new ArgumentException("The last operation completed on the socket was not a receive or send");
+            }
+        }
+
+        // This method is invoked when an asynchronous receive operation completes. 
+        // If the remote host closed the connection, then the socket is closed.  
+        // If data was received then the data is echoed back to the client.
+        //
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        private void ProcessReceive(SocketAsyncEventArgs e)
+        {
+            try
+            {
+                // check if the remote host closed the connection 
+                if (e.BytesTransferred > 0 && e.SocketError == SocketError.Success)
+                {
+                    //读取数据                  
+                    _conn.AppendData(new ArraySegment<byte>(e.Buffer, e.Offset, e.BytesTransferred));
+
+                    byte[] buffData = DataPool.BytesGet(receiveBufferSize);
+                    e.SetBuffer(buffData, 0, buffData.Length);
+
+                    // start loop
+                    if (!socket.ReceiveAsync(e))
+                        ProcessReceive(e);
+                    return;
+                }
+            }
+            catch (Exception ex)
+            {
+                Logger.Error(ex);
+            }
+            Close();
+        }
+
+        #endregion
+
+
+        #region Send
+
+        LongTaskHelp Send_task = new LongTaskHelp();
+
+
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        void Send_Flush()
+        {
+            while (true) 
+            {
+                try
+                {
+                    _conn.Flush();
+                    global::System.Threading.SpinWait.SpinUntil(() => false, 1);
+                }
+                catch (Exception ex) when (!(ex.GetBaseException() is ThreadInterruptedException))
+                {
+                    Logger.Error(ex);
+                }
+            }           
+        }
+
+        #endregion
+
+
+
+
+
+
+    }
+}

+ 395 - 0
dotnet/Library/Sers/Sers.CL/Socket/Sers.CL.Socket.Iocp/Mode/SpinWait/DeliveryServer.cs

@@ -0,0 +1,395 @@
+//  https://freshflower.iteye.com/blog/2285272 
+
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Sockets;
+using System.Runtime.CompilerServices;
+using System.Threading;
+using Sers.CL.Socket.Iocp.Mode.Timer;
+using Sers.Core.CL.MessageDelivery;
+using Vit.Core.Module.Log;
+using Vit.Core.Util.Net;
+using Vit.Core.Util.Pool;
+using Vit.Core.Util.Threading;
+
+namespace Sers.CL.Socket.Iocp.Mode.SpinWait
+{
+    public class DeliveryServer: IDeliveryServer
+    {
+
+
+        public Sers.Core.Util.StreamSecurity.SecurityManager securityManager;
+
+        /// <summary>
+        /// 服务端 监听地址。若不指定则监听所有网卡。例如: "127.0.0.1"、"sers.cloud"。
+        /// </summary>
+        public string host = null;
+
+        /// <summary>
+        /// 服务端 监听端口号(默认4501)。例如: 4501。
+        /// </summary>
+        public int port = 4501;
+
+
+
+        /// <summary>
+        /// 接收缓存区大小
+        /// </summary>
+        public int receiveBufferSize = 8 * 1024; 
+
+
+        public Action<IDeliveryConnection> Conn_OnDisconnected { private get; set; }
+        public Action<IDeliveryConnection> Conn_OnConnected { private get; set; }
+      
+
+
+        /// <summary>
+        /// 最大连接数
+        /// </summary>
+        private int maxConnectCount;
+
+
+        public int MaxConnCount { get { return maxConnectCount; }
+            set {
+                maxConnectCount = value;
+                m_maxNumberAcceptedClients = new Semaphore(maxConnectCount, maxConnectCount);
+                //pool_ReceiveEventArgs.Capacity = maxConnectCount;
+            }
+        }
+
+
+
+        /// <summary>
+        ///  connHashCode -> DeliveryConnection
+        /// </summary>
+        readonly ConcurrentDictionary<int, DeliveryConnection> connMap = new ConcurrentDictionary<int, DeliveryConnection>();
+
+        public IEnumerable<IDeliveryConnection> ConnectedList => connMap.Values.Select(conn=>((IDeliveryConnection)conn));
+
+
+        public DeliveryServer()
+        {
+            MaxConnCount = 20000;
+        }
+
+
+
+
+        #region Start Stop
+
+
+        public bool Start()
+        {
+            Stop();
+
+            try
+            {
+                Logger.Info("[CL.DeliveryServer] Socket.Iocp,starting... host:" + host + " port:" + port);
+
+                //(x.1)
+                connMap.Clear();
+
+                //(x.2)    
+                Send_task.threadCount = 1;
+                Send_task.action = Send_Flush;
+                Send_task.Start();
+
+                //(x.3)
+                IPEndPoint localEndPoint = new IPEndPoint(String.IsNullOrEmpty(host) ? IPAddress.Any : NetHelp.ParseToIPAddress(host), port);
+                listenSocket = new global::System.Net.Sockets.Socket(localEndPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
+                listenSocket.Bind(localEndPoint);
+
+
+                // start the server with a listen backlog of 100 connections
+                listenSocket.Listen(maxConnectCount);
+                // post accepts on the listening socket
+                StartAccept(null);
+
+                Logger.Info("[CL.DeliveryServer] Socket.Iocp,started.");
+                return true;
+            }
+            catch (Exception ex)
+            {
+                Logger.Error(ex);
+            }
+            return false;
+        }
+
+
+        /// <summary>
+        /// 停止服务
+        /// </summary>
+        public void Stop()
+        {
+
+            Send_task.Stop();
+
+
+            if (listenSocket == null) return;
+
+            var listenSocket_ = listenSocket;
+            listenSocket = null;
+
+            //(x.1) stop conn
+            ConnectedList.ToList().ForEach(Delivery_OnDisconnected);
+            connMap.Clear();
+
+            //(x.2) close Socket
+            try
+            {
+                listenSocket_.Close();
+                listenSocket_.Dispose();
+                //listenSocket_.Shutdown(SocketShutdown.Both);
+            }
+            catch (Exception ex)
+            {
+                Logger.Error(ex);
+            }
+
+        }
+        #endregion
+
+
+        #region Iocp
+
+
+        global::System.Net.Sockets.Socket listenSocket;
+
+        Semaphore m_maxNumberAcceptedClients;
+
+
+        #region ReceiveEventArgs
+
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        SocketAsyncEventArgs ReceiveEventArgs_Create(global::System.Net.Sockets.Socket socket)
+        {
+            var conn = Delivery_OnConnected(socket);           
+
+            SocketAsyncEventArgs receiveEventArgs = new SocketAsyncEventArgs();
+            receiveEventArgs.Completed += new EventHandler<SocketAsyncEventArgs>(IO_Completed);
+
+
+            var buff = DataPool.BytesGet(receiveBufferSize);
+            receiveEventArgs.SetBuffer(buff, 0, buff.Length);
+ 
+            receiveEventArgs.UserToken = conn;
+            conn.receiveEventArgs = receiveEventArgs;
+
+            return receiveEventArgs;
+        }
+
+        //ObjectPool<SocketAsyncEventArgs> pool_ReceiveEventArgs = new ObjectPool<SocketAsyncEventArgs>();
+
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        void ReceiveEventArgs_Release(SocketAsyncEventArgs receiveEventArgs)
+        {
+            receiveEventArgs.UserToken = null;
+            //pool_ReceiveEventArgs.Push(receiveEventArgs);
+        }
+        #endregion
+
+
+
+      
+        // Begins an operation to accept a connection request from the client 
+        //
+        // <param name="acceptEventArg">The context object to use when issuing 
+        // the accept operation on the server's listening socket</param>
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        private void StartAccept(SocketAsyncEventArgs acceptEventArgs)
+        {
+            if (acceptEventArgs == null)
+            {
+                acceptEventArgs = new SocketAsyncEventArgs();
+                acceptEventArgs.Completed += new EventHandler<SocketAsyncEventArgs>(AcceptEventArg_Completed);
+            }
+            else
+            {
+                // socket must be cleared since the context object is being reused
+                acceptEventArgs.AcceptSocket = null;
+            }
+
+            m_maxNumberAcceptedClients.WaitOne();
+            if (!listenSocket.AcceptAsync(acceptEventArgs))
+            {
+                AcceptEventArg_Completed(null,acceptEventArgs);
+            }
+        }
+
+        // This method is the callback method associated with Socket.AcceptAsync 
+        // operations and is invoked when an accept operation is complete
+        //
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        private void AcceptEventArg_Completed(object sender, SocketAsyncEventArgs acceptEventArgs)
+        {
+            try
+            {          
+                // Get the socket for the accepted client connection and put it into the 
+                //ReadEventArg object user token
+                SocketAsyncEventArgs receiveEventArgs = ReceiveEventArgs_Create(acceptEventArgs.AcceptSocket);               
+
+                if (!acceptEventArgs.AcceptSocket.ReceiveAsync(receiveEventArgs))
+                {
+                    ProcessReceive(receiveEventArgs);
+                }
+            }
+            catch (Exception ex)
+            {
+                Logger.Error(ex);
+            }
+
+            // Accept the next connection request
+            if (acceptEventArgs.SocketError == SocketError.OperationAborted) return;
+            StartAccept(acceptEventArgs);
+        }
+
+
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        public void IO_Completed(object sender, SocketAsyncEventArgs e)
+        {
+            // determine which type of operation just completed and call the associated handler
+            switch (e.LastOperation)
+            {
+                case SocketAsyncOperation.Receive:
+                    ProcessReceive(e);
+                    break;
+                case SocketAsyncOperation.Send:
+                    Logger.Info("[Iocp]IO_Completed Send");
+                    return;
+                //    ProcessSend(e);
+                //    break;
+                default:
+                    Logger.Info("[Iocp]IO_Completed default");
+                    throw new ArgumentException("The last operation completed on the socket was not a receive or send");
+            }
+
+        }
+
+
+        // This method is invoked when an asynchronous receive operation completes. 
+        // If the remote host closed the connection, then the socket is closed.  
+        // If data was received then the data is echoed back to the client.
+        //
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        private void ProcessReceive(SocketAsyncEventArgs e)
+        {
+            //读取数据
+            DeliveryConnection conn = e.UserToken as DeliveryConnection;
+            if (conn == null) return;
+
+
+            try
+            {            
+
+                // check if the remote host closed the connection               
+                if (e.BytesTransferred > 0 && e.SocketError == SocketError.Success)
+                {
+                    //读取数据
+                    conn.AppendData(new ArraySegment<byte>(e.Buffer, e.Offset, e.BytesTransferred));
+
+                    byte[] buffData = DataPool.BytesGet(receiveBufferSize);
+                    e.SetBuffer(buffData, 0, buffData.Length);
+
+                    // start loop
+                    //继续接收. 为什么要这么写,请看Socket.ReceiveAsync方法的说明
+                    if (!conn.socket.ReceiveAsync(e))
+                        ProcessReceive(e);
+                    return;
+                } 
+            }
+            catch (Exception ex)
+            {
+                Logger.Error(ex);
+            }
+            conn.Close();
+        }
+
+
+
+        #endregion
+
+
+        #region Send
+
+        LongTaskHelp Send_task = new LongTaskHelp();
+
+
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        void Send_Flush()
+        {
+            while (true)
+            {
+                try
+                {
+                    foreach (var conn in connMap.Values)
+                    {
+                        conn.Flush();
+                    }
+                    global::System.Threading.SpinWait.SpinUntil(() => false, 1);
+                }
+                catch (Exception ex) when (!(ex.GetBaseException() is ThreadInterruptedException))
+                {
+                    Logger.Error(ex);
+                }
+            }            
+        }
+
+        #endregion
+
+
+        #region Delivery_Event
+
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        private DeliveryConnection Delivery_OnConnected(global::System.Net.Sockets.Socket socket)
+        {
+            var conn = new DeliveryConnection();
+            conn.securityManager = securityManager;
+            conn.Init(socket);           
+
+            conn.Conn_OnDisconnected = Delivery_OnDisconnected;
+
+            connMap[conn.GetHashCode()] = conn;
+            try
+            {
+                Conn_OnConnected?.Invoke(conn);
+            }
+            catch (Exception ex)
+            {
+                Logger.Error(ex);
+            }
+
+
+            return conn;
+        }
+
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        private void Delivery_OnDisconnected(IDeliveryConnection _conn)
+        {
+            // decrement the counter keeping track of the total number of clients connected to the server
+            m_maxNumberAcceptedClients.Release();
+
+
+            var conn = (DeliveryConnection)_conn;
+
+            ReceiveEventArgs_Release(conn.receiveEventArgs);
+
+            connMap.TryRemove(_conn.GetHashCode(),out _);
+
+            try
+            {
+                Conn_OnDisconnected?.Invoke(_conn);
+            }
+            catch (Exception ex)
+            {
+                Logger.Error(ex);
+            }
+
+        }
+        #endregion
+
+
+    }
+}

+ 1 - 1
dotnet/Library/Sers/Sers.CL/Socket/Sers.CL.Socket.Iocp/Mode/Fast/DeliveryClient.cs → dotnet/Library/Sers/Sers.CL/Socket/Sers.CL.Socket.Iocp/Mode/Timer/DeliveryClient.cs

@@ -11,7 +11,7 @@ using Vit.Core.Util.Net;
 using Vit.Core.Util.Pool;
 using Vit.Core.Util.Threading;
 
-namespace Sers.CL.Socket.Iocp.Mode.Fast
+namespace Sers.CL.Socket.Iocp.Mode.Timer
 {
     public class DeliveryClient : IDeliveryClient
     {

+ 1 - 1
dotnet/Library/Sers/Sers.CL/Socket/Sers.CL.Socket.Iocp/Mode/Fast/DeliveryConnection.cs → dotnet/Library/Sers/Sers.CL/Socket/Sers.CL.Socket.Iocp/Mode/Timer/DeliveryConnection.cs

@@ -7,7 +7,7 @@ using Vit.Core.Module.Log;
 using Vit.Core.Util.Pipelines;
 using Vit.Extensions;
 
-namespace Sers.CL.Socket.Iocp.Mode.Fast
+namespace Sers.CL.Socket.Iocp.Mode.Timer
 {
     public class DeliveryConnection : IDeliveryConnection
     {

+ 1 - 1
dotnet/Library/Sers/Sers.CL/Socket/Sers.CL.Socket.Iocp/Mode/Fast/DeliveryServer.cs → dotnet/Library/Sers/Sers.CL/Socket/Sers.CL.Socket.Iocp/Mode/Timer/DeliveryServer.cs

@@ -14,7 +14,7 @@ using Vit.Core.Util.Net;
 using Vit.Core.Util.Pool;
 using Vit.Core.Util.Threading;
 
-namespace Sers.CL.Socket.Iocp.Mode.Fast
+namespace Sers.CL.Socket.Iocp.Mode.Timer
 {
     public class DeliveryServer: IDeliveryServer
     {

+ 14 - 3
dotnet/Library/Sers/Sers.CL/Socket/Sers.CL.Socket.Iocp/OrganizeClientBuilder.cs

@@ -35,16 +35,27 @@ namespace Sers.CL.Socket.Iocp
                         organizeList.Add(new OrganizeClient(delivery, config));
                     }
                     break;
+                case "Timer":
+                    {
+                        var delivery = new Mode.Timer.DeliveryClient();
+
+                        delivery.host = config["host"].ConvertToString();
+                        delivery.port = config["port"].Convert<int>();
 
-                //case "Fast":
+                        ((Mode.Timer.DeliveryConnection)delivery.conn).securityManager = securityManager;
+
+                        organizeList.Add(new OrganizeClient(delivery, config));
+                    }
+                    break;
+                //case "SpinWait":
                 default:
                     {
-                        var delivery = new Mode.Fast.DeliveryClient();
+                        var delivery = new Mode.SpinWait.DeliveryClient();
 
                         delivery.host = config["host"].ConvertToString();
                         delivery.port = config["port"].Convert<int>();
 
-                        ((Mode.Fast.DeliveryConnection)delivery.conn).securityManager = securityManager;
+                        ((Mode.Timer.DeliveryConnection)delivery.conn).securityManager = securityManager;
 
                         organizeList.Add(new OrganizeClient(delivery, config));
                     }

+ 13 - 2
dotnet/Library/Sers/Sers.CL/Socket/Sers.CL.Socket.Iocp/OrganizeServerBuilder.cs

@@ -36,11 +36,22 @@ namespace Sers.CL.Socket.Iocp
                         organizeList.Add(new OrganizeServer(delivery, config));
                     }
                     break;
+                case "Timer":          
+                    {
+                        var delivery = new Mode.Timer.DeliveryServer();
+
+                        delivery.securityManager = securityManager;
 
-                //case "Fast":
+                        delivery.host = config["host"].ConvertToString();
+                        delivery.port = config["port"].Convert<int>();
+
+                        organizeList.Add(new OrganizeServer(delivery, config));
+                    }
+                    break;
+                //case "SpinWait":
                 default:
                     {
-                        var delivery = new Mode.Fast.DeliveryServer();
+                        var delivery = new Mode.SpinWait.DeliveryServer();
 
                         delivery.securityManager = securityManager;
 

+ 1 - 1
dotnet/Library/Sers/Sers.CL/Test/CommunicationManage/CmClient/appsettings.json

@@ -48,7 +48,7 @@
           /* the class of builder in assemblyFile  */
           "className": "Sers.CL.Socket.Iocp.OrganizeClientBuilder",
 
-          //"mode": "Simple",
+          //"mode": "Timer", // Simple SpinWait(默认)
 
           /* (x.2) config */
           /* 服务端 host地址。例如: "127.0.0.1"、"sers.cloud" */

+ 1 - 1
dotnet/Library/Sers/Sers.CL/Test/CommunicationManage/CmServer/appsettings.json

@@ -45,7 +45,7 @@
           /* the class of Builder in assemblyFile  */
           "className": "Sers.CL.Socket.Iocp.OrganizeServerBuilder",
 
-          //"mode": "Simple",
+          //"mode": "Timer", // Simple SpinWait(默认)
 
           /* (x.2) config */
           /* 服务端 监听地址。若不指定则监听所有网卡。例如: "127.0.0.1"、"sers.cloud"。*/

+ 1 - 1
dotnet/Library/Sers/Sers.CL/Test/MessageDelivery/DeliveryClient/Program.cs

@@ -78,7 +78,7 @@ namespace DeliveryTest
 
         static void StartClient()
         {
-            var client = new Sers.CL.Socket.Iocp.Mode.Fast.DeliveryClient();
+            var client = new Sers.CL.Socket.Iocp.Mode.Timer.DeliveryClient();
             //var client = new Sers.CL.Socket.ThreadWait.DeliveryClient();
 
             //client.host = host;

+ 1 - 1
dotnet/Library/Sers/Sers.CL/Test/MessageDelivery/DeliveryServer/Program.cs

@@ -43,7 +43,7 @@ namespace DeliveryTest
 
         static void StartServer()
         {
-            var server = new Sers.CL.Socket.Iocp.Mode.Fast.DeliveryServer();
+            var server = new Sers.CL.Socket.Iocp.Mode.Timer.DeliveryServer();
             //var server = new Sers.CL.Socket.ThreadWait.DeliveryServer();
             // server.port = port;