diff --git a/src/HPSocket.Net/Base/Server.cs b/src/HPSocket.Net/Base/Server.cs index 02594760ddcd1cb61c6e28247c6938005fe0c622..498e0865efd6d37aa17798153ac7db612ea9bdeb 100644 --- a/src/HPSocket.Net/Base/Server.cs +++ b/src/HPSocket.Net/Base/Server.cs @@ -6,8 +6,6 @@ using System.Text; #if !NET20 && !NET30 && !NET35 using System.Threading.Tasks; using System.Collections.Concurrent; -#else -using System.Collections.Generic; #endif namespace HPSocket.Base @@ -431,18 +429,18 @@ namespace HPSocket.Base return obj == null ? default : (T)obj; } - #if NET20 || NET30 || NET35 +#if NET20 || NET30 || NET35 /// - /// 获取所有扩展数据 + /// 获取所有附加数据 /// /// public Dictionary GetAllExtra() { return ExtraData.GetAll(); } - #else +#else /// - /// 获取所有扩展数据 + /// 获取所有附加数据 /// /// public ConcurrentDictionary GetAllExtra() @@ -451,7 +449,6 @@ namespace HPSocket.Base } #endif - /// public bool RemoveExtra(IntPtr connId) => ExtraData.Remove(connId); diff --git a/src/HPSocket.Net/Common/ExtraData.cs b/src/HPSocket.Net/Common/ExtraData.cs index 21e38e62397a06fc4d6d3c9409f3b12ca670f72a..125178ae33e15023cb71c42952e9ccf90ea1a53a 100644 --- a/src/HPSocket.Net/Common/ExtraData.cs +++ b/src/HPSocket.Net/Common/ExtraData.cs @@ -46,19 +46,16 @@ namespace HPSocket } /// - /// 获取所有扩展数据 + /// 获取所有附加数据 /// /// public Dictionary GetAll() { - return _dict; + return new Dictionary(_dict); } - - /// /// 设置附加数据 - /// /// /// /// @@ -149,17 +146,16 @@ namespace HPSocket } /// - /// 获取所有扩展数据 + /// 获取所有附加数据 /// /// public ConcurrentDictionary GetAll() { - return _dict; + return new ConcurrentDictionary(_dict); } /// /// 设置附加数据 - /// /// /// /// diff --git a/src/HPSocket.Net/HPSocket.Net.xml b/src/HPSocket.Net/HPSocket.Net.xml index a8fdbddde796fd86b0375b300745d7bcf812bee0..c2bc5a742f6edd3e3d31cd4831bcaf2bc0fc6371 100644 --- a/src/HPSocket.Net/HPSocket.Net.xml +++ b/src/HPSocket.Net/HPSocket.Net.xml @@ -986,7 +986,7 @@ - 获取所有扩展数据 + 获取所有附加数据 @@ -1518,14 +1518,13 @@ - 获取所有扩展数据 + 获取所有附加数据 设置附加数据 - @@ -4419,7 +4418,7 @@ - 获取所有扩展数据 + 获取所有附加数据 diff --git a/src/HPSocket.Net/IServer.cs b/src/HPSocket.Net/IServer.cs index 6cf00124d9d3b3b66db3f164da3a62ce6a396f87..5aa3638ed29e14d6c1ae63c87087a1e575d46517 100644 --- a/src/HPSocket.Net/IServer.cs +++ b/src/HPSocket.Net/IServer.cs @@ -1,10 +1,7 @@ using System; using System.Collections.Generic; #if !NET20 && !NET30 && !NET35 -using System.Threading.Tasks; using System.Collections.Concurrent; -#else -using System.Collections.Generic; #endif namespace HPSocket @@ -339,15 +336,15 @@ namespace HPSocket /// T GetExtra(IntPtr connId); - #if NET20 || NET30 || NET35 +#if NET20 || NET30 || NET35 /// - /// 获取所有扩展数据 + /// 获取所有附加数据 /// /// Dictionary GetAllExtra(); - #else +#else /// - /// 获取所有扩展数据 + /// 获取所有附加数据 /// /// ConcurrentDictionary GetAllExtra();