public void Stop() { running = false; timer.Change(-1, -1); socket.Dispose(); socket = null; FirewallOpen = false; FinishedTestingFirewall = false; SaveCache(); }
public void Stop() { IsRunning = false; udptimer.Change(-1, -1); if (socket != null) { socket.PacketReceived -= UdpPacketReceived; socket.Dispose(); socket = null; } FirewallOpen = false; TestingFirewall = true; }
public void Stop() { running = false; udptimer.Change(-1, -1); if (socket != null) { socket.Exception -= SocketException; socket.PacketReceived -= UdpPacketReceived; socket.Dispose(); socket = null; } FirewallOpen = false; FinishedTestingFirewall = false; }
private async Task CheckDownloadTimeout(AresUdpSocket socket) { DateTime now = DateTime.Now; if (now.Subtract(lastackinfo).TotalSeconds >= 30) { IsDownloading = false; try { socket.Close(); } catch { } socket.Dispose(); DownloadComplete?.Invoke(this, EventArgs.Empty); } else { await Task.Delay(1000); } }