Пример #1
0
    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);
    }
Пример #2
0
 //程序退出关闭相关线程
 private void OnApplicationQuit()
 {
     serverThread.close();
 }