From 313c08e7140e4668a5153b64ceee6d69e43063a7 Mon Sep 17 00:00:00 2001 From: mafeng Date: Fri, 12 Jan 2018 23:39:30 +0800 Subject: [PATCH] aa --- socket.core/Common/AsyncUserToken.cs | 22 ------------------- .../Common/SocketAsyncEventArgsPool.cs | 9 -------- socket.core/Server/TcpServer.cs | 6 ++++- test.window.client/App.config | 2 +- test.window.server/App.config | 2 +- 5 files changed, 7 insertions(+), 34 deletions(-) delete mode 100644 socket.core/Common/AsyncUserToken.cs diff --git a/socket.core/Common/AsyncUserToken.cs b/socket.core/Common/AsyncUserToken.cs deleted file mode 100644 index 237692c..0000000 --- a/socket.core/Common/AsyncUserToken.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Net.Sockets; -using System.Text; - -namespace socket.core.Common -{ - /// - /// Token - /// - internal class AsyncUserToken - { - /// - /// 连接ID - /// - public Guid connectId { get; set; } - /// - /// 所使用的套接字 - /// - internal Socket Socket { get; set; } - } -} diff --git a/socket.core/Common/SocketAsyncEventArgsPool.cs b/socket.core/Common/SocketAsyncEventArgsPool.cs index 100f52f..82fddc6 100644 --- a/socket.core/Common/SocketAsyncEventArgsPool.cs +++ b/socket.core/Common/SocketAsyncEventArgsPool.cs @@ -61,14 +61,5 @@ public int Count { get { return m_pool.Count; } } - - /// - /// 清空 - /// - //public void Clear() - //{ - // m_pool.Clear(); - //} - } } diff --git a/socket.core/Server/TcpServer.cs b/socket.core/Server/TcpServer.cs index d67ae36..63aa73e 100644 --- a/socket.core/Server/TcpServer.cs +++ b/socket.core/Server/TcpServer.cs @@ -277,7 +277,7 @@ private void ProcessReceive(SocketAsyncEventArgs e) } } //准备下次接收数据 - if (client.socket.Connected==true) + //if (client.socket.Connected==true) { if (!client.socket.ReceiveAsync(e)) { @@ -443,6 +443,10 @@ private void CloseClientSocket(SocketAsyncEventArgs e) connectClient.TryTake(out conn); m_maxNumberAcceptedClients.Release(); } + else + { + + } } #endregion diff --git a/test.window.client/App.config b/test.window.client/App.config index f9e513a..0845228 100644 --- a/test.window.client/App.config +++ b/test.window.client/App.config @@ -6,7 +6,7 @@ - + diff --git a/test.window.server/App.config b/test.window.server/App.config index 49a573c..519af6f 100644 --- a/test.window.server/App.config +++ b/test.window.server/App.config @@ -5,7 +5,7 @@ - +