​
​
I don’t know if this will help, you can use OSProcess to run the ifconfig
Unix (MAC OS) command, kind of like this:

​Use ifconfig -s to get a list of the interfaces:

​Iface   MTU Met   RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR
Flg
enp2s0     1500 0         0      0      0 0             0      0
0      0 BMU
lo        65536 0      1187      0      0 0          1187      0
0      0 LRU
wlp3s0     1500 0      4943      0      0 0          2904      0
0      0 BMRU

then:
​
Ifconfig -a wlp3s0

and get back something like this:

wlp3s0    Link encap:Ethernet  HWaddr 94:53:30:14:aa:6d
          inet addr:192.168.0.14  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::21f3:b81d:eab3:f830/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4998 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2904 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6864552 (6.8 MB)  TX bytes:295070 (295.0 KB)

The second line has the host address and the broadcast address. I didn't
say easy, I said possible. This works in Linux and MacOS. I dunno about MS
Windows.





Encrypted email at jgpfers...@protonmail.com
Web: www.objectnets.net and www.objectnets.org

On May 13, 2018, at 11:27, Julián Maestri <serp...@gmail.com> wrote:

(impossible without the added networking prims, and still unreliable
> whether it will find the correct ones with...)
>

The problem seems to be here: he->h_addr_list[0] its a list of addresses
and only the first one is used.

Unix: https://github.com/pharo-project/pharo-vm/blob/e0ce2d9d78c3c
7b37bbc12cd8730c6a15f1f057c/opensmalltalk-vm/platforms/
unix/plugins/SocketPlugin/sqUnixSocket.c#L273
Windows: https://github.com/pharo-project/pharo-vm/blob/e0ce2d9d78c3c
7b37bbc12cd8730c6a15f1f057c/opensmalltalk-vm/platforms/
win32/plugins/SocketPlugin/sqWin32NewNet.c#L1843
h_addr_list explanation: http://www.gnu.org/software/li
bc/manual/html_node/Host-Names.html

But changing that might affect the whole networking package, so i don't
think it's going to be changed soon.


On 13 May 2018 at 15:20, Hilaire <hila...@drgeo.eu> wrote:

> I already tried the one you suggested, but it returns the loopback IP on
> P7.
>
> With the Henrik SSDP package, I can get the IP:
>
> SSDPParticipant new allLocalV4Addresses.
>
> However when I activate a second network interface, this last one returns
> an empty collection. When inactivating this second interface, it still
> returns an empty collection...
>
> Hilaire
>
>
> Le 13/05/2018 à 20:05, Julián Maestri a écrit :
>
>> NetNameResolver localHostAddress. "#[192 168 0 4]"
>>
>
> --
> Dr. Geo
> http://drgeo.eu
>
>
>
>

Reply via email to