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

Elliott Slaughter elliottslaughter at gmail.com
Sun Mar 7 07:20:52 UTC 2010


On Sat, Mar 6, 2010 at 11:10 PM, Elliott Slaughter <
elliottslaughter at gmail.com> wrote:

> On Sat, Mar 6, 2010 at 10:44 PM, Hans Hübner <hans.huebner at gmail.com>wrote:
>
>> Elliott,
>>
>> to my knowledge, usocket does not provide an API to get a list of all
>> network interfaces, which is what you need to do if you want to know
>> the local IP address(es).
>>
>> One quick workaround is to invoke ifconfig and parse the output.  I
>> know that this is not a very satisfying or portable approach, but it
>> is quick.
>>
>
> Thanks. I wanted to make sure I wasn't missing something.
>

Wait -- what about the following?

* (usocket::get-hosts-by-name (usocket::get-host-name))

(#(192 168 1 100) #(5 223 109 11) #(192 168 56 1))

I know these functions aren't exported from usocket, but is there any reason
why they couldn't be?

-- 
Elliott Slaughter

"Don't worry about what anybody else is going to do. The best way to predict
the future is to invent it." - Alan Kay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/usocket-devel/attachments/20100306/27c01c45/attachment.html>


More information about the usocket-devel mailing list