
Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
>>I have some trouble while doing a connection with a java application to
>>a web server. I would like to limit the time of the opening connection
[quoted text clipped - 9 lines]
> interrupt a thread that makes it immediately abandon any I/O
> operation.
From the Thread.interrupt() javadocs:
<quote>
If this thread is blocked in an invocation of the wait(), wait(long), or
wait(long, int) methods of the Object class, or of the join(), join(long),
join(long, int), sleep(long), or sleep(long, int), methods of this class,
then its interrupt status will be cleared and it will receive an
InterruptedException.
If this thread is blocked in an I/O operation upon an interruptible channel
then the channel will be closed, the thread's interrupt status will be set,
and the thread will receive a ClosedByInterruptException.
</quote>
- Oliver
Chris Uppal - 15 Nov 2005 16:41 GMT
> If this thread is blocked in an I/O operation upon an interruptible
> channel then the channel will be closed, the thread's interrupt status
> will be set, and the thread will receive a ClosedByInterruptException.
Hmm... There's a thought. Does a server socket count as an interruptible
channel ?
A bit awkward of interupting one thread waiting for incoming connections closed
the whole socket.
I suppose I should go look it up...
-- chris
Roedy Green - 15 Nov 2005 19:13 GMT
On Tue, 15 Nov 2005 16:41:52 -0000, "Chris Uppal"
<chris.uppal@metagnostic.REMOVE-THIS.org> wrote, quoted or indirectly
quoted someone who said :
>Hmm... There's a thought. Does a server socket count as an interruptible
>channel ?
These would pretty well have to be, otherwise how would sockets
implement their own timeouts? Let us know what you discover.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.