I gave Socket soc = new Socket(host,port); Now that the host computer is in a running state, the socket is created immediately.
But when the computer is turned off or restarted, it takes about 40 seconds to answer this line. I tried using soc.setSoTimeout(timeout); But this line is used after creating the Socket. Therefore, this does not help much.
Also this seems like a bug in JAVA. http://bugs.sun.com/bugdatabase/view_bug.do;:YfiG?bug_id=5092063
I tried several workarounds provided in this link, for example, adding the machine port and hostname to the etc / hosts file. But that will not work. Due to this delay, due to DNS resolution when creating a socket, the response time to my system will suffer greatly.
Any help would be greatly appreciated.
thanks sr
source share