<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Ok, well I spent the evening looking into this. It's unclear if reverting the new/old socket stuff in Pharo is a good idea,<div>or if we just adjust things a bit in the name lookup that would solve things. There are two questions to resolve<br><div><br></div><div>(1) Do we want to return an IPV4 address from the network lookup? or an IPV6 address?&nbsp;</div><div>(2) What do we do when we have 2 or more active IP interfaces on the machine, prompt for which one to use? Pick one at random, use the first or last one?&nbsp;</div><div><br></div><div>If the community can decide what to do, then we can propose a solution.&nbsp;</div><div><br></div><div>So how it works.&nbsp;</div><div><br></div><div>NetNameResolver localHostAddress</div><div><br></div><div>fe80::21c:42ff:fe00:9%en5(otter-2.local),0(0)</div><div>&nbsp;</div><div>Gah... what's that?&nbsp;</div><div><br></div><div>Well the interface is:</div><div><br></div><div><div>en5: flags=8963&lt;UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST&gt; mtu 1500</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>inet6 fe80::21c:42ff:fe00:9%en5 prefixlen 64 scopeid 0x8&nbsp;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>inet 10.37.129.2 netmask 0xffffff00 broadcast 10.37.129.255</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ether 00:1c:42:00:00:09&nbsp;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>media: autoselect status: active</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>supported media: autoselect</div><div><br></div></div><div>Thus it's giving me an IPV6 address.</div><div><br></div><div>The chore is more complicated that one would care to see. I see Microsoft had a hand in defining the spec.&nbsp;</div><div><br></div><div>So it first asks the&nbsp;<span class="Apple-style-span" style="color: rgb(73, 0, 134); font-family: Menlo; font-size: 11px; ">gethostname&nbsp;<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; ">for the name of the host. &nbsp;As an example my macbook pro has&nbsp;</span></span></div><div><div><div>Otter-2.local</div><div><br></div><div>which is what</div></div><div>[otter-2:~] johnmci% hostname</div><div>Otter-2.local</div><div><br></div><div>That's a bonjour assigned name since if I do</div><div><div>[otter-2:~] johnmci% nslookup Otter-2.local</div><div>Server:<span class="Apple-tab-span" style="white-space:pre">                </span>192.168.1.7</div><div>Address:<span class="Apple-tab-span" style="white-space:pre">        </span>192.168.1.7#53</div><div><br></div><div>** server can't find Otter-2.local: NXDOMAIN</div><div><br></div><div><br></div></div><div>Then we are off to:&nbsp;</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(73, 0, 134); ">getnameinfo</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(73, 0, 134); "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(73, 0, 134); "><font class="Apple-style-span" color="#000000" face="Helvetica"><span class="Apple-style-span" style="font-size: medium; ">which returns a chain of&nbsp;&nbsp;IPV4 and IPV6 &nbsp;address that&nbsp;Otter-2.local would resolve to.&nbsp;</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(73, 0, 134); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; ">In this case there are six address, broken in to IPV6 and IPV4</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(73, 0, 134); "><font class="Apple-style-span" color="#000000" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(73, 0, 134); "><font class="Apple-style-span" color="#000000" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">fe80::21c:42ff:fe00:8%en4(otter-2.local),0(0)-inet6-stream-tcp&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">fe80::21c:42ff:fe00:9%en5(otter-2.local),0(0)-inet6-stream-tcp&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">fe80::21b:63ff:fe02:d2db%en1(otter-2.local),0(0)-inet6-stream-tcp&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">10.211.55.2(10.211.55.2),0(0)-inet4-stream-tcp&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">10.37.129.2(10.37.129.2),0(0)-inet4-stream-tcp&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">192.168.1.141(192.168.1.141),0(0)-inet4-stream-tcp</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">So looks kinda random, but it's not. It's defined by Microsoft &amp; committee etc. in&nbsp;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;"><a href="http://www.faqs.org/rfcs/rfc3484.html">http://www.faqs.org/rfcs/rfc3484.html</a></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;">The objective is to sort the list into some order. I must say you can't actually tell from reading the docs, and things over&nbsp;</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;">the past decade have changed. So I refer to some cheat sheets that *might* be correct.&nbsp;</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><br></div></span></font></div></div></div><div><div>Now the macbook pro in this case uses 192.168.1.141 as the assigned tcp/ip address from our internal DHCP server.&nbsp;</div><div>The 10.211.55.2 &nbsp;is a parallels shared network adaptor and</div><div>10.37.129.2 is the parallels host-only network adaptor.&nbsp;</div><div><br></div><div>All three interfaces show as active, and if you consider the 'ifconfig -a' &nbsp;below you would be hard pressed to determine which interface is the one facing the&nbsp;</div><div>company intranet.&nbsp;</div><div><br></div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">[otter-2:~] johnmci% ifconfig -a</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">lo0: flags=8049&lt;UP,LOOPBACK,RUNNING,MULTICAST&gt; mtu 16384</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>inet6 ::1 prefixlen 128&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>inet 127.0.0.1 netmask 0xff000000&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">gif0: flags=8010&lt;POINTOPOINT,MULTICAST&gt; mtu 1280</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">stf0: flags=0&lt;&gt; mtu 1280</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">en0: flags=8863&lt;UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>ether 00:17:f2:d9:57:35&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>media: autoselect status: inactive</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>supported media: autoselect 10baseT/UTP &lt;half-duplex&gt; 10baseT/UTP &lt;full-duplex&gt; 10baseT/UTP &lt;full-duplex,hw-loopback&gt; 10baseT/UTP &lt;full-duplex,flow-control&gt; 100baseTX &lt;half-duplex&gt; 100baseTX &lt;full-duplex&gt; 100baseTX &lt;full-duplex,hw-loopback&gt; 100baseTX &lt;full-duplex,flow-control&gt; 1000baseT &lt;full-duplex&gt; 1000baseT &lt;full-duplex,hw-loopback&gt; 1000baseT &lt;full-duplex,flow-control&gt; none</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">fw0: flags=8863&lt;UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST&gt; mtu 2030</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>lladdr 00:19:e3:ff:fe:93:92:7c&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>media: autoselect &lt;full-duplex&gt; status: inactive</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>supported media: autoselect &lt;full-duplex&gt;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">en1: flags=8863&lt;UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>inet6 fe80::21b:63ff:fe02:d2db%en1 prefixlen 64 scopeid 0x6&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>inet 192.168.1.141 netmask 0xffffff00 broadcast 192.168.1.255</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>ether 00:1b:63:02:d2:db&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>media: autoselect status: active</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>supported media: autoselect</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">en4: flags=8963&lt;UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST&gt; mtu 1500</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>inet6 fe80::21c:42ff:fe00:8%en4 prefixlen 64 scopeid 0x7&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>inet 10.211.55.2 netmask 0xffffff00 broadcast 10.211.55.255</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>ether 00:1c:42:00:00:08&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>media: autoselect status: active</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>supported media: autoselect</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">en5: flags=8963&lt;UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST&gt; mtu 1500</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>inet6 fe80::21c:42ff:fe00:9%en5 prefixlen 64 scopeid 0x8&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>inet 10.37.129.2 netmask 0xffffff00 broadcast 10.37.129.255</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>ether 00:1c:42:00:00:09&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>media: autoselect status: active</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>supported media: autoselect</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; ">Where en0 is ethernet jack, fw0 is firewire, en1 is wireless, en4 &amp; en5 are virtual.&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; ">Now the bias from the committee is&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;"><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></span></font></div></div><div><span class="Apple-style-span" style="font-family: monospace, arial, sans-serif; "><pre>precedence  ::1/128       50
precedence  ::/0          40
precedence  2002::/16     30
precedence ::/96          20
precedence ::ffff:0:0/96  10<br></pre></span></div><div><span class="Apple-style-span" style="font-family: monospace, arial, sans-serif; "><pre>scopev4 ::ffff:169.254.0.0/112  2
scopev4 ::ffff:127.0.0.0/104    2
scopev4 ::ffff:10.0.0.0/104     5
scopev4 ::ffff:172.16.0.0/108   5
scopev4 ::ffff:192.168.0.0/112  5
scopev4 ::ffff:0.0.0.0/96       14</pre></span><div><br></div><div>This means of course the 10.0.0.0 address sorts before the 192.168.0.0 address. How helpful.&nbsp;</div><div><br></div><div>So how do we know *which* is the proper address to use? Well no idea!</div><div><br></div><div>However let's see what the API does.&nbsp;</div><div><br></div><div><div>NetNameResolver class&gt;&gt; addressesForName: hostName</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>| adresses |</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>adresses := SocketAddressInformation</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>forHost: hostName</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>service: ''</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>flags: 0</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>addressFamily: &nbsp;0</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>socketType: SocketAddressInformation socketTypeStream</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>protocol: SocketAddressInformation protocolTCP.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>^adresses</div></div><div><font class="Apple-style-span" face="Helvetica, arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="Helvetica, arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="Helvetica, arial, sans-serif">Now I can make it return just IPV4 address by doing:&nbsp;</font></div><div><font class="Apple-style-span" face="Helvetica, arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="Helvetica, arial, sans-serif"><span class="Apple-style-span" style="font-family: Helvetica; "><div><div>NetNameResolver class&gt;&gt; addressesForName: hostName</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>| adresses |</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>adresses := SocketAddressInformation</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>forHost: hostName</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>service: ''</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>flags: 0</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>addressFamily: &nbsp;SocketAddressInformation addressFamilyINET4</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>socketType: SocketAddressInformation socketTypeStream</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>protocol: SocketAddressInformation protocolTCP.</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>^adresses</div></div><div><font class="Apple-style-span" face="Helvetica, arial, sans-serif"><br></font></div><div>which then NetNameResolver localHostAddress gives:&nbsp;</div><div>10.37.129.2(10.37.129.2),0(0)</div><div><br></div><div>I can also supply a service number string &nbsp;say SSH &nbsp;'22'&nbsp;</div><div>that give back&nbsp;</div><div>10.37.129.2(10.37.129.2),22(ssh)</div><div>since ssh is binding on all interfaces that's valid.&nbsp;</div><div><br></div><div>Technically the&nbsp;<span class="Apple-style-span" style="font-family: Menlo, arial, sans-serif; color: rgb(73, 0, 134); font-size: 11px; ">getnameinfo<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Helvetica, arial, sans-serif; font-size: medium; ">&nbsp;gives back three address but again the code below grabs the first one which according to the&nbsp;rfc3484 is more likely to be the correct answer.&nbsp;</span></span></div><div><br></div><div><div>addressForName: hostName</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>"NetNameResolver addressForName: 'impara.de' "</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>"NetNameResolver addressForName: 'localhost' "</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>"NetNameResolver addressForName: '127.0.0.1' "</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>| addresses |</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self useOldNetwork</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>ifTrue: [^self oldAddressForName: hostName].</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>addresses := self addressesForName: hostName.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>^addresses</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>ifEmpty: [nil]</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>ifNotEmpty: [addresses first socketAddress]</div><div><br></div><div>But grabbing the first one doesn't meet people's expectations of correctness, however we just don't have enough information to decide *what* is correct.&nbsp;</div><div><br></div><div>Now some people say OH let's return the en0 one because that is correct? Really how do you know?&nbsp;</div><div>On my computer en0 is ethernet, but since I'm using wireless then en1 is the correct one.&nbsp;</div><div><br></div><div>Obviously I could look in the list of IPV6 address find the LOWEST en# value, then grab the IPV4 entry. &nbsp;This would assume I check for the fact that the IPV6</div><div>interface has an IPV4 address and the sort order for the IPV6 is the same as for the IPV4.</div><div><br></div><div>Gee that sounds ok?&nbsp;</div><div><br></div><div>Well it's not, when for example I tether my MacBook Pro to my iPhone and abuse my privilege to move data over the cellular carrier, ah sorry you USA ATT folks,&nbsp;</div><div>then the interface is:&nbsp;</div><div><br></div><div><div>en6: flags=8863&lt;UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>inet6 fe80::226:8ff:fe72:5aa%en6 prefixlen 64 scopeid 0x9&nbsp;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>inet 192.168.20.2 netmask 0xffffff00 broadcast 192.168.20.255</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ether 00:26:08:72:05:aa&nbsp;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>media: 10baseT/UTP status: active</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>supported media: 10baseT/UTP</div><div><br></div><div><br></div><div>which fails the test that the lowest active en# is the one we want to use.&nbsp;</div><div><br></div><div>10.37.129.2(10.37.129.2),0(0)-inet4-stream-tcp&nbsp;</div><div>10.211.55.2(10.211.55.2),0(0)-inet4-stream-tcp&nbsp;</div><div>192.168.20.2(192.168.20.2),0(0)-inet4-stream-tcp)</div></div><div><br></div><div><br></div><div>So the question is what would the community like to see happen. Well other than hide under a rock and see if the problem goes away...&nbsp;</div><div><br></div><div><br></div></div></span></font></div><div><div>On 2010-03-12, at 8:41 AM, Chris Cunnington wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">How is NetNameResolver choosing the interface to return an IP address from?&nbsp;<div><br></div><div>In Cobalt this is a problem. You need the right address to connect to other spaces. Cobalt won't let you enter it by hand, so you are at the mercy of its guessing the correct interface.&nbsp;</div>
<div><br></div><div>NetNameResolver localAddressString&nbsp;</div><div><br></div><div>executed in Workspace produces the IP from my fw0 interface, which is useless. I need it to look at ppp0.&nbsp;</div><div><br></div><div>Can it be told which interface to look at?</div>
<div>How does it choose?&nbsp;</div><div><br></div><div>Chris&nbsp;</div>
<br></blockquote></div><br><div>
<span class="Apple-style-span" style="font-size: 12px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">--</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">===========================================================================</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">John M. McIntosh &lt;<a href="mailto:johnmci@smalltalkconsulting.com">johnmci@smalltalkconsulting.com</a>&gt; &nbsp; Twitter: &nbsp;squeaker68882</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Corporate Smalltalk Consulting Ltd.&nbsp;&nbsp;<a href="http://www.smalltalkconsulting.com">http://www.smalltalkconsulting.com</a></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">===========================================================================</font></div><div><br></div></div></div></div></div></div></span></div></span><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br></div></div></div></body></html>