This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: NetworkInterface doesn't see new InetAddress after they've been updated
- From: Tom Tromey <tromey at redhat dot com>
- To: "Scott Gilbertson" <scottg at mantatest dot com>
- Cc: <java at gcc dot gnu dot org>
- Date: 03 May 2003 15:59:32 -0600
- Subject: Re: NetworkInterface doesn't see new InetAddress after they've been updated
- References: <04c701c310f8$29b9c480$3c16a8c0@mantatest.com>
- Reply-to: tromey at redhat dot com
>>>>> "Scott" == Scott Gilbertson <scottg@mantatest.com> writes:
Scott> I tried java.net.NetworkInterface.getByName() and
Scott> getInetAddresses(), only to discover that the interfaces and
Scott> addresses are cached (at least in the posix case), and
Scott> therefore don't reflect the changes the user has made (possibly
Scott> by enabling DHCP).
Scott> Looking at the J2SDK 1.4.0 Javadoc, I don't see any indication
Scott> of whether the caching is as-specified for this API. In my
Scott> case, I'd be happier if it got a fresh set of IP addresses each
Scott> time it was called.
This seems reasonable to me.
Maybe Michael Koch could comment though.
Tom