P
Paul Taylor
Hi,
If my internet connection is down then the openConnection() call takes too
long to time out:
url.openConnection();
I have tried setting:
-Dsun.net.client.defaultConnectTimeout=2000
-Dsun.net.client.defaultReadTimeout=2000
on the command line and it doesn't affect the timeout. Also tried setting
them with the System.setProperty function call but this also doesn't work.
My openConnection() call is in a seperate thread which I have tried
interrupting but this also doesn't work!
I am beginning to think that after searching the internet that maybe that
the openConnection function isn't of much use. It is easy to use, but
only if I could somehow control the thing? Could someone please give me
some pointers, maybe answer one or more of the following questions:
(1) Can openConnect() be stopped somehow?
(2) Should defaultConnectTimeout and defaultReadTimeout work? or am I
doing something wrong here?
(3) Do I need to forget about openConnect() and do something else?
Regards,
Paul Taylor.
If my internet connection is down then the openConnection() call takes too
long to time out:
url.openConnection();
I have tried setting:
-Dsun.net.client.defaultConnectTimeout=2000
-Dsun.net.client.defaultReadTimeout=2000
on the command line and it doesn't affect the timeout. Also tried setting
them with the System.setProperty function call but this also doesn't work.
My openConnection() call is in a seperate thread which I have tried
interrupting but this also doesn't work!
I am beginning to think that after searching the internet that maybe that
the openConnection function isn't of much use. It is easy to use, but
only if I could somehow control the thing? Could someone please give me
some pointers, maybe answer one or more of the following questions:
(1) Can openConnect() be stopped somehow?
(2) Should defaultConnectTimeout and defaultReadTimeout work? or am I
doing something wrong here?
(3) Do I need to forget about openConnect() and do something else?
Regards,
Paul Taylor.