private void m_connect() { if (ping != null) { Destroy(ping); } ping = gameObject.AddComponent <HFPing>(); ping.Init(serverIP, 5); GameLooper.BackToMainThread(connectedHandler); }
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); }