From e3809d64f05d0b8c2b078815c7421b6be5c2ca16 Mon Sep 17 00:00:00 2001 From: fajiao <1519100073@qq.com> Date: Tue, 18 Apr 2023 16:46:48 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E6=94=B9=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VibrateAlarm/Service/AsyncTcpServer.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/JiLinApp.Docking/VibrateAlarm/Service/AsyncTcpServer.cs b/JiLinApp.Docking/VibrateAlarm/Service/AsyncTcpServer.cs index 196bc5f..e12d00a 100644 --- a/JiLinApp.Docking/VibrateAlarm/Service/AsyncTcpServer.cs +++ b/JiLinApp.Docking/VibrateAlarm/Service/AsyncTcpServer.cs @@ -231,7 +231,7 @@ public class AsyncTcpServer : IDisposable } catch (Exception) { - throw; + return; } if (readBytesNum == 0) { @@ -307,7 +307,6 @@ public class AsyncTcpServer : IDisposable } catch (Exception) { - throw; } } @@ -363,7 +362,6 @@ public class AsyncTcpServer : IDisposable } catch (Exception) { - throw; } } @@ -402,7 +400,13 @@ public class AsyncTcpServer : IDisposable private void HandleDatagramWritten(IAsyncResult ar) { - (ar.AsyncState as TcpClient)?.GetStream().EndWrite(ar); + try + { + (ar.AsyncState as TcpClient)?.GetStream().EndWrite(ar); + } + catch (Exception) + { + } } #endregion Send