>I have another question:
>
[quoted text clipped - 11 lines]
> the program is blocked in "in.readLine()"
> how can I stop this thread?
You have two choices--you can either close the stream or you can set a
timeout on the socket (setSoTimeout). (Interrupting the thread might work--I
havn't tried it and I don't recall reading about it working.) Setting the
socket timeout is good for detecting client (or server) failure, although
you have to combine it with something that makes a periodic request
(heartbeat.). For example, to detect client failure, the server sets the
socket timeout to 600 seconds (10 minutes). The client heartbeat makes a
request every 300 seconds that it *doesn't* already make a request. The
socket throws the timeout exception when the heartbeats are no longer
detected.
Matt Humphrey matth@ivizNOSPAM.com http://www.iviz.com/
JTL.zheng - 10 Oct 2006 05:07 GMT
Thank you very much for your help
I choose to close the stream
it's just a very simple point to point messager
so I didn's use the setSoTimeout