On Saturday, 8 October 2016 at 13:46:28 UTC, Jakob Ovrum wrote:
...
The doc for InternetAddress does say it uses InternetHost internally, and the docs do recommend getAddress over using Internet{Host, Address} directly,

I have no idea why we don't use std.socket.getAddress; I'll look into that. If switching over is viable (which I imagine it is) and sufficient, then that sounds like a great solution short term.

but maybe InternetHost.getHostByName should use getAddress internally to benefit from getaddrinfo.

Sounds good :) I can't comment on what wider impact that might have though.

If not, it should probably at least warn about not being reentrant.

It is "kind of" reentrant - it has synchronisation around the gethostbyname call. Things fall apart when gethostbyname is accessed directly, e.g. by a third party library, as is the case in our application.

Reply via email to