Explorar el Código

accept要catch异常,避免异常导致无法继续接收连接

tanghai hace 7 años
padre
commit
4913216b0c
Se han modificado 1 ficheros con 8 adiciones y 1 borrados
  1. 8 1
      Unity/Assets/Scripts/Module/Message/NetworkComponent.cs

+ 8 - 1
Unity/Assets/Scripts/Module/Message/NetworkComponent.cs

@@ -66,7 +66,14 @@ namespace ETModel
 					return;
 				}
 
-				await this.Accept();
+				try
+				{
+					await this.Accept();
+				}
+				catch (Exception e)
+				{
+					Log.Error(e);
+				}
 			}
 		}