Browse Source

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

master
fajiao 2 years ago
parent
commit
e3809d64f0
  1. 10
      JiLinApp.Docking/VibrateAlarm/Service/AsyncTcpServer.cs

10
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;
} }
} }
@ -401,9 +399,15 @@ public class AsyncTcpServer : IDisposable
} }
private void HandleDatagramWritten(IAsyncResult ar) private void HandleDatagramWritten(IAsyncResult ar)
{
try
{ {
(ar.AsyncState as TcpClient)?.GetStream().EndWrite(ar); (ar.AsyncState as TcpClient)?.GetStream().EndWrite(ar);
} }
catch (Exception)
{
}
}
#endregion Send #endregion Send

Loading…
Cancel
Save