From: <jp...@rn...> - 2003-02-11 11:25:47
|
> If you start the member *after* you have received your DHCP address, and > *don't* use bind_addr, then the eth0 interface should be selected. > > With JDK 1.4, we will be able to select the first non-loopback > interface, so lo would be skipped if eth0 was available. But even then, > once you bind to lo, and eth0 comes up afterwards, you're bound to lo > for the lifetime of that member. In my setup it won't bind to eth0, even if it's already up. Let me post a bit of your last e-mail about my problems: >interfaces=InetAddress.getAllByName(InetAddress.getLocalHos().getHostAddress()); [snip] >As you can see we use getAllByName() based on getHostAddress(). >So this is completely dependent on the host address. This will change in 1.4. If you choose one of the interfaces that are bound to "getLocalHost" this will get the ip's associated with the localhost (in my setup was "laptop") I had a eth0 interface enabled by dhcp, provided by my work network. That dhcp settings would not change my etc/hosts or anything like that. So, I have a ifconfig showing eth0 and lo, but the code above selects lo only as it's the only interface bound with "laptop". eth0 matches with a name like "laptop-xx". If you use that 1.4 feature that you state, keeping the code above, you'll get something like this: "Get all interfaces bound with localhostname" "Of those, select the first non-lo interface" (in my setup I have none [eth0 is not bound to hostname but to another name] so it would fall back to lo again) Once again I ask: Why can't this interface selection be similar to the one found in McastReceiverTest? (I have not seen the code, but it seems to select every interface and not only the ones bound to hostname) Or, is this a problem of my dhcp settings (mine or of my network) that should write something else on my /etc/hosts or maybe rename my localhost name? This is not that clear to me, and it could only be something related to my local linux setup, as if I boot in windows [with dhcp] I'll get JG working ok, but if I boot in linux [again with dhcp, in the same network] it will not... Thanks Joao Clemente |