On Thu, 2 Mar 2023 22:35:17 GMT, David Holmes <dhol...@openjdk.org> wrote:

> We can replace `gethostbyname`, which is deprecated on Windows and Linux, 
> with `getaddrinfo`. This API is available on all supported platforms and so 
> can be placed in shared code. @djelinski pointed out that `getaddrinfo` can 
> resolve both IP addresses and host names so the two step approach used in 
> `networkStream::connect` is not necessary and we can do away with 
> `os::get_host_by_name()` completely.
> 
> The build is updated to enable winsock deprecation warnings, and now we need 
> to use `ws2_32.lib` we can drop `wsock32.lib` (as it is basically a subset - 
> again thanks @djelinski ).
> 
> Testing
>     - all Oracle builds in tiers 1-5
>     - All GHA builds
> 
> The actual code change has to be manually tested because the code is only 
> used by Ideal Graph Printing to connect to the Ideal Graph Visualizer. I've 
> manually tested on Windows and Linux and @tobiasholenstein tested macOS.
> 
> Thanks.

This pull request has now been integrated.

Changeset: d7298245
Author:    David Holmes <dhol...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/d7298245d6759f62e253b5cf0df975db17fdbf82
Stats:     41 lines in 6 files changed: 13 ins; 17 del; 11 mod

8286781: Replace the deprecated/obsolete gethostbyname and inet_addr calls

Co-authored-by: Daniel Jeliński <djelin...@openjdk.org>
Reviewed-by: kbarrett, djelinski

-------------

PR: https://git.openjdk.org/jdk/pull/12842

Reply via email to