Exemple #1
0
 private void m_connect()
 {
     if (ping != null)
     {
         Destroy(ping);
     }
     ping = gameObject.AddComponent <HFPing>();
     ping.Init(serverIP, 5);
     GameLooper.BackToMainThread(connectedHandler);
 }
Exemple #2
0
        public void Close()
        {
            if (socket != null)
            {
                socket.Close(true);
                socket = null;
                completionCache.Clear();
                messageQueue.Clear();
                IsDispatch = false;
            }

            if (ping != null)
            {
                Destroy(ping);
                ping = null;
            }

            Destroy(this);
        }