Browse Source

[fix] 修改连接异常处理逻辑

master
fajiao 1 year ago
parent
commit
e3809d64f0
  1. 12
      JiLinApp.Docking/VibrateAlarm/Service/AsyncTcpServer.cs

12
JiLinApp.Docking/VibrateAlarm/Service/AsyncTcpServer.cs

@ -231,7 +231,7 @@ public class AsyncTcpServer : IDisposable
} }
catch (Exception) catch (Exception)
{ {
throw; return;
} }
if (readBytesNum == 0) if (readBytesNum == 0)
{ {
@ -307,7 +307,6 @@ public class AsyncTcpServer : IDisposable
} }
catch (Exception) catch (Exception)
{ {
throw;
} }
} }
@ -363,7 +362,6 @@ public class AsyncTcpServer : IDisposable
} }
catch (Exception) catch (Exception)
{ {
throw;
} }
} }
@ -402,7 +400,13 @@ public class AsyncTcpServer : IDisposable
private void HandleDatagramWritten(IAsyncResult ar) private void HandleDatagramWritten(IAsyncResult ar)
{ {
(ar.AsyncState as TcpClient)?.GetStream().EndWrite(ar); try
{
(ar.AsyncState as TcpClient)?.GetStream().EndWrite(ar);
}
catch (Exception)
{
}
} }
#endregion Send #endregion Send

Loading…
Cancel
Save