public void CloseConnection() { if (ServerConnect.IsConnected) { ServerConnect.Disconnect(); } if (ServerConnect.IsConnecting) { ServerConnect.StopConnectionTry(); } KadEngine.Stop(); }