diff --git a/StarAgent/Program.cs b/StarAgent/Program.cs index 38b8804b..8df7a322 100644 --- a/StarAgent/Program.cs +++ b/StarAgent/Program.cs @@ -1,13 +1,10 @@ using System.Diagnostics; -using System.Net; using System.Net.NetworkInformation; -using System.Net.Sockets; using System.Reflection; using NewLife; using NewLife.Agent; using NewLife.Log; using NewLife.Model; -using NewLife.Net; using NewLife.Reflection; using NewLife.Remoting; using NewLife.Serialization; @@ -363,9 +360,7 @@ public void StartLocalServer(Int32 port) // 必须支持Udp,因为需要支持局域网广播搜索功能 var svr = new ApiServer(port) { -#if !NET40 ReuseAddress = true, -#endif Tracer = _factory?.Tracer, Log = XTrace.Log, EncoderLog = XTrace.Log, @@ -381,14 +376,6 @@ public void StartLocalServer(Int32 port) Log = XTrace.Log }, null); - //svr.EnsureCreate(); - //if (svr.Server is NetServer ns) - //{ - // // 升级核心库以后不需要反射 - // //ns.ReuseAddress = true; - // ns.SetValue("ReuseAddress", true); - //} - _server = svr; svr.Start(); } diff --git a/Stardust/LocalStarClient.cs b/Stardust/LocalStarClient.cs index 08179b6d..25c356bd 100644 --- a/Stardust/LocalStarClient.cs +++ b/Stardust/LocalStarClient.cs @@ -482,12 +482,7 @@ public static Task ProbeAsync(String? url = null, String? version = null, String var msg = encoder.Decode(rs); if (msg != null) { -#if NET40 - var js = encoder.DecodeResult(msg.Action, msg.Data, rs); - var info = (AgentInfo)encoder.Convert(js, typeof(AgentInfo)); -#else var info = (AgentInfo?)encoder.DecodeResult(msg.Action, msg.Data, rs, typeof(AgentInfo)); -#endif yield return info; } diff --git a/Stardust/StarClient.cs b/Stardust/StarClient.cs index 057effa6..c27e8007 100644 --- a/Stardust/StarClient.cs +++ b/Stardust/StarClient.cs @@ -113,12 +113,8 @@ protected override void Dispose(Boolean disposing) /// /// 取消通知 /// -#if NET40 - public override async Task InvokeAsync(HttpMethod method, String action, Object? args = null, Action? onRequest = null, CancellationToken cancellationToken = default) -#else [return: MaybeNull] public override async Task InvokeAsync(HttpMethod method, String action, Object? args = null, Action? onRequest = null, CancellationToken cancellationToken = default) -#endif { var needLogin = !Logined && !action.EqualIgnoreCase("Node/Login", "Node/Logout"); if (needLogin) diff --git a/Stardust/StarFactory.cs b/Stardust/StarFactory.cs index 060ca025..ba740d6b 100644 --- a/Stardust/StarFactory.cs +++ b/Stardust/StarFactory.cs @@ -254,9 +254,7 @@ private void Init() ioc.TryAddSingleton(typeof(ICacheProvider), typeof(CacheProvider)); } -#if !NET40 [MemberNotNullWhen(true, nameof(_client))] -#endif private Boolean Valid() { //if (Server.IsNullOrEmpty()) throw new ArgumentNullException(nameof(Server)); diff --git a/Stardust/Stardust.csproj b/Stardust/Stardust.csproj index 3482c8d3..009bedef 100644 --- a/Stardust/Stardust.csproj +++ b/Stardust/Stardust.csproj @@ -94,11 +94,11 @@ - - + + - + diff --git a/Test/Test.csproj b/Test/Test.csproj index f0e66198..ba5ea2c7 100644 --- a/Test/Test.csproj +++ b/Test/Test.csproj @@ -29,7 +29,7 @@ - +