On Fri, 1 Jan 2016, Philip Homburg wrote:
- Ideally, operating systems should ship with a happy eyeballs implementation in the C library. I don't know any that does. It is not such a great idea for applications to roll their own. Mostly because you may want knobs to configure things system wide.
For C there probably are libraries.
- All applications should loop over all addresses returned by getaddrinfo. There is simply no excuse not to. If java makes it impossible to iterate over all addresses that it is java that is horribly broken.
I disagree here. ATM most services only have one IPv4 address. In the transition time between protocols many will have IPv4 AND IPv6 but in the near future (let's say 5-10 years) most will either have IPv4 OR IPv6 and dual stack will slowly fade out.
And it's not so easy to handle multiple connects. You can either optimize for speed (open multiple connections parallel) or for load (open one after the other) or ignore it (single connect) or randomly choose an address (e.g. what postfix does). All of these methods have advantages and disadvantages and depend on the application.
And it's not so easy to decide when a connection works or not, as it can fail on multiple levels and so on and so on. Many programs are extremely simple and implementing a full featured we-try-all network access is total overkill. So also in the future the majority of tools will only open one connection and try once. It's wishful thinking to assume otherwise.
For our company applications it took me a lot of time and experience to create a non-blocking non-threading portable C network library to cope with the many existing issues. I know how much work that involves both in the application and the libraries.
Thus the main question here is if parallel connects are important enough, so that JOSM needs to support that feature or not. Currently I think not.
We have a number of network issues with the Java network code beside the rather ugly IPv6 handling and maybe in the future we'll replace it with another library and maybe that will include algorithms for multiple connects. The question already came up in a recent ticket. But that's a lot of work and also does not magically solve all the problems.
Ciao -- http://www.dstoecker.eu/ (PGP key available) _______________________________________________ josm-dev mailing list [email protected] https://lists.openstreetmap.org/listinfo/josm-dev
