Page 1 of 1

Any chance some variant of socket library has support for socket.gethostbyaddr?

Posted: Sun Aug 07, 2022 1:55 am
by Jibun no kage
Any chance some variant of socket library has support for socket.gethostbyaddr?

Re: Any chance some variant of socket library has support for socket.gethostbyaddr?

Posted: Mon Aug 08, 2022 2:57 am
by Jibun no kage
Let me ask a different way, would it be something that might be added, feature add to say the MicroPython usocket module?

Re: Any chance some variant of socket library has support for socket.gethostbyaddr?

Posted: Mon Aug 08, 2022 2:28 pm
by scruss
I doubt it: gethostbyaddr is no longer recommended for general use:

Code: Select all

       The gethostbyname*(), gethostbyaddr*(), herror(), and hstrerror()
       functions are obsolete.  Applications should use getaddrinfo(3),
       getnameinfo(3), and gai_strerror(3) instead.
(source: gethostbyname(3) Linux manual page).

MicroPython docs add: "Using getaddrinfo is the most efficient (both in terms of memory and processing power) and portable way to work with addresses.".

What does getaddrinfo not do for you?