Java getLocalHost() caching

Java getLocalHost() has to make a call to the Kernel API to obtain the desired results, which is a time consuming factor. Java caches results only for five seconds that is not useful for applications which run for a longer time.

-Dnsk.java.cachegetLocalHost=true is used to overcome the unnecessary calls made to the Kernel API, and cache the results of getLocalHost() until the application ends.

WARNING:

Do not change the IP address of the system while running the application.