tags:

views:

109

answers:

1

With JRE6 (SUN VM on Windows XP), getLocalhost() freezes sometimes.

Interestingly, if in the debugger in Eclipse, it does not freeze. I narrowed it down to a single getLocalhost() call using old school println. There is nothing particularly special about the code, that I can see.

Has anyone else seen this problem?

+1  A: 

You did not specify how long it freezes for... or did you mean completely frozen, never returning.

If the local host name (returned from a JNI call) is not "localhost", the IP address for the local name is resolved using InetAddress.getAddressFromNameService(). This is a DNS call that could conceivably block for an unspecified amount of time finding and accessing the name server.

Software Monkey