IEnumerator AttemptReconnection() { if (_server != null) { _server.close(); } yield return(new WaitForSeconds(1f)); Debug.Log("starting another instance of server thread"); yield return(StartCoroutine(RunServer())); yield return(null); }
//程序退出关闭相关线程 private void OnApplicationQuit() { serverThread.close(); }