We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have vps with both ipv4 and ipv6, but seem when set v6 only, it's still use ipv4 for download
my code
listenEndpoints = new Dictionary<string, IPEndPoint> { { "ipv6", new IPEndPoint(IPAddress.IPv6Any, MySettings.Data.TorrentPort) } }; settingBuilder.ListenEndPoints = listenEndpoints;
count v4 and v6 connection
private int countV4 = 0; private int countV6 = 0; private readonly HashSet<string> activePeers = new HashSet<string>(); void AddConnectionTypeCount(TorrentManager manager) { manager.PeerConnected += (o1, e1) => { string peerAddress = e1.Peer.Uri.ToString(); lock (activePeers) { if (!activePeers.Contains(peerAddress)) { activePeers.Add(peerAddress); if (e1.Peer.Uri.HostNameType == UriHostNameType.IPv4) { countV4++; } else if (e1.Peer.Uri.HostNameType == UriHostNameType.IPv6) { countV6++; } } } }; manager.PeerDisconnected += (o1, e1) => { string peerAddress = e1.Peer.Uri.ToString(); lock (activePeers) { if (activePeers.Contains(peerAddress)) { activePeers.Remove(peerAddress); if (e1.Peer.Uri.HostNameType == UriHostNameType.IPv4 && countV4 > 0) { countV4--; } else if (e1.Peer.Uri.HostNameType == UriHostNameType.IPv6 && countV6 > 0) { countV6--; } } } }; }
Result: v6 usually = 0, v4 count > 0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have vps with both ipv4 and ipv6, but seem when set v6 only, it's still use ipv4 for download
my code
count v4 and v6 connection
Result: v6 usually = 0, v4 count > 0
The text was updated successfully, but these errors were encountered: