Skip to content
New issue

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

Add inet:getaddr/2 #1396

Merged

Conversation

pguyot
Copy link
Collaborator

@pguyot pguyot commented Dec 14, 2024

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

Copy link
Collaborator

@bettio bettio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I would use domain and IP addresses that are safe for examples and tests such as example.com and its IP address.
As a side note it would be better to target main and keep this branch focused to disterl and its dependencies (also for review reasons), but I'm not that strong opinionated about this.

{ok, {127, 0, 0, 1}} = inet:getaddr(localhost, inet),
{ok, {127, 0, 0, 1}} = inet:getaddr("localhost", inet),
{ok, {_, _, _, _}} = inet:getaddr("www.atomvm.net", inet),
{ok, {173, 48, 222, 98}} = inet:getaddr("pool-173-48-222-98.bstnma.fios.verizon.net", inet),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as I know example.com is guaranteed to be static and assigned to 93.184.216.34.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not sure about this statement and it seems example.com resolves differently here and on CI.

@pguyot pguyot force-pushed the w50/add-inet-getaddr branch 2 times, most recently from 902a485 to 100faf4 Compare December 14, 2024 20:06
@pguyot
Copy link
Collaborator Author

pguyot commented Dec 14, 2024

Looks good, I would use domain and IP addresses that are safe for examples and tests such as example.com and its IP address. As a side note it would be better to target main and keep this branch focused to disterl and its dependencies (also for review reasons), but I'm not that strong opinionated about this.

This is a dependency of disterl. I wrote a dist layer implementation called socket_dist that I tested on BEAM and used inet:getaddr/2. Likewise, my epmd client uses inet:getaddr/2.

@pguyot pguyot force-pushed the w50/add-inet-getaddr branch from 100faf4 to 0a4236f Compare December 14, 2024 20:41
Signed-off-by: Paul Guyot <[email protected]>
@pguyot pguyot force-pushed the w50/add-inet-getaddr branch from 0a4236f to 63e3961 Compare December 14, 2024 20:43
@bettio bettio merged commit 293c475 into atomvm:feature/distributed-erlang Dec 15, 2024
80 checks passed
@pguyot pguyot deleted the w50/add-inet-getaddr branch December 15, 2024 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants