[usocket-devel] Determining the local host address from wildcard host

Hans Hübner hans.huebner at gmail.com
Sun Mar 7 07:23:54 UTC 2010


On Sun, Mar 7, 2010 at 08:10, Elliott Slaughter
<elliottslaughter at gmail.com> wrote:

> Supposing that I wanted to find a more portable solution, would I need to
> write a custom CFFI wrapper over gethostbyname or getaddrinfo? And would
> this sort of functionality be considered for inclusion in usocket?

Using gethostbyname is not a robust approach in the first place.  Many
systems have no usable host name or multiple network interfaces.  You
will need to iterate over the list of interfaces and give the user a
way to use any of the addresses that the local machine has.  Add
Windows and ABCL to the mix, and you'll have more issues to solve.

If you're really interested in a solution, you'll have to find
something that does not depend on CFFI.  Erik can give you more
information on usocket's policies.

-Hans




More information about the usocket-devel mailing list