@@ -38,7 +38,7 @@ namespace Base
TChannel channel = this.idChannels[id];
channel.Dispose();
}
-
+ this.acceptor.Dispose();
this.poller = null;
@@ -8,7 +8,7 @@ namespace Base
/// <summary>
/// 封装Socket,将回调push到主线程处理
/// </summary>
- public class TSocket: IDisposable
+ public sealed class TSocket: IDisposable
{
private readonly TPoller poller;
private Socket socket;
@@ -65,8 +65,9 @@ namespace Base
return;
- this.socket.Close();
+ this.socket.Dispose();
+ this.innArgs.Dispose();
+ this.outArgs.Dispose();
this.socket = null;
@@ -32,7 +32,7 @@ namespace Base
- public class ObjectManager : IDisposable
+ public sealed class ObjectManager : IDisposable
private readonly Dictionary<string, Assembly> assemblies = new Dictionary<string, Assembly>();
@@ -57,7 +57,7 @@ namespace Model
T t;
if (!this.dict.TryGetValue(type, out t))
- throw new Exception($"{typeof(T)} 没有找到配置, key: {type}");
+ throw new KeyNotFoundException($"{typeof(T)} 没有找到配置, key: {type}");
return t;