Baldwintm

I have a bit of code that creates a new socket.
I get NoRouteToHostException when the IP cannot be reached.
My problem is that it takes too long to throw the exception.
It takes about 30 seconds to throw the exception, how can I make this timeout shorter

Here is a small example of what I'm doing:

try
{
socket = new java.net.Socket(host, port);
}
catch(java.net.NoRouteToHostException e)
{
System.err.println(host + " is unreachable.");
}


Re: Visual J# General Socket connect timeout?

SivaPrasadd

Hi,

We are investigating on this, we ll get back to you soon.

Regards,

Siva






Re: Visual J# General Socket connect timeout?

SivaPrasadd

Hi,

Sorry, there is no other option to make this timeout shorter.

But we can set the timeout exception for reading the input stream, with the socket object.

so this timeout exception gives "Timeout Expired or server not available..".

Regards,






Re: Visual J# General Socket connect timeout?

Baldwintm

That is disappointing,
But thank you.
How would I go about recommending this to Microsoft for future implementations




Re: Visual J# General Socket connect timeout?

Raj Thilak

Hi,

we will track this recommendation.Thank you for your suggestion.

regards

Raj Thilak