N
Nigel Underwood
All,
I am trying to connect to a Socket on a remote machine that may take upto 1
minute to respond to the connection request. To allow for this, I am making
a time out on my connection request to be 5 minutes. However, I seem to be
having a problem in that even though I make the timeout 5 minutes, it
timesout only after 20 seconds. If I make the timeout less than 20 seconds
it works fine, but anything above 20 seconds makes the timeout 20 seconds.
I've listed my code below and for reference, its JVM 1.4.2_06.
try
{
Socket mySocket = new Socket(); // Create the socket
InetSocketAddress myAddress = new InetSocketAddress( "172.16.100.10",
25 );
// Wait for upto 5 minutes for a connection
mySocket .connect( myAddress , 300000 );
}
catch ( Exception e )
{
System.out.println( "** Error opening " + e.getMessage() );
}
Thanks guys
Nigel.
I am trying to connect to a Socket on a remote machine that may take upto 1
minute to respond to the connection request. To allow for this, I am making
a time out on my connection request to be 5 minutes. However, I seem to be
having a problem in that even though I make the timeout 5 minutes, it
timesout only after 20 seconds. If I make the timeout less than 20 seconds
it works fine, but anything above 20 seconds makes the timeout 20 seconds.
I've listed my code below and for reference, its JVM 1.4.2_06.
try
{
Socket mySocket = new Socket(); // Create the socket
InetSocketAddress myAddress = new InetSocketAddress( "172.16.100.10",
25 );
// Wait for upto 5 minutes for a connection
mySocket .connect( myAddress , 300000 );
}
catch ( Exception e )
{
System.out.println( "** Error opening " + e.getMessage() );
}
Thanks guys
Nigel.