wut?
On which one?
That entire WebServer.java is a dumpster fire.
ipv4 assumption
fair question. So the previous code would reach out to a thing I run in Google App Engine to get your effective IPv4 public address.
You may or may not be able to accept connections on that address but, if you can reach the app engine site you certainly have working ipv4.
However, if that site is down or blocked for some reason your node would assume IPv4 didn't work and would never try to use IPv4 to reach other nodes
not very robust as that relies on you not kicking the bucket and/or something continuing to pay the bills
So the logic now assumes you can reach other nodes by ipv4. If you can't, no major loss, other things will still be tried
yeah, a blind cascade of trying things sounds better
yeah, it is on my decentralization disclosure as something to fix
I hope everything moves to ipv6. Then it is easy to get a list of local interfaces, any IPs in the group global are good things to use for peering (probably)
how does that logic work if one is on an ipv6-only carrier? those are already a thing in china and africa
If you are on ipv6 only, you will try to connect via ipv4 (which won't work) and via ipv6 (which will).
I like ipv6 so it has a higher weighting anyways
should it wait for failures or just try everything at once?
When you are trying to make a new connection to a peer, it puts everything that might work into a group and then picks one
using some weighting
eventually I could see saving some state and results from that
but since connections tend to stay up after forming, this seems to work pretty well
That is what the WeightedRandomSelector is about