Hi all I currently have a program that sends a number of strings in a loop from the server to the client. the client receives these messages by typing 'START' into the console and displays them indefinatley at quite a fast rate. Is there a way to type 'stop' into the console on the client side to interrupt the thread? At ...
Sorry. I misread your previous post. Now I understand that. So, the conclusion is, it is fine to have the while loop check for isInterrupted(), as long as the user still hold the intention the break the Thread from sleep, wait, nio...... I wish to give you my duke dollar, but I keep getting server error while try to assign duke ...
What is the intended behavior ? The intended behaviour is defined in http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html#interrupt() ' 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.' DatagramSocket not being an InterruptibleChannel, this piece doesn't apply. None of the other pieces ...
I would take it as the class that started that thread, but a bit of context might help. thats what I thought, however the argument I came across was that anybody who owns an instance of that Thread, or has it passed to it would be the owner of the thread during that period of execution. Its basically from a perspective ...
Always Learning wrote: I am not just firing off a question. This is a new but approachable subject to me and will generate questions aimed at better understanding. The answer may be all too obvious for you and clearly easy for anyone to understand but I think rather than offer what you did already, it would be nice if you could ...
The answer seems almost obvious because when an exception is caught, execution proceeds to a different part of the program but I see nothing preventing re-interruption. But there may be something underlying the mechanics of exception handling that causes any process attempting to interrupt another handing an exception to block. I am not sure and I have referenced the API. Unless ...
I don't know if that'll work. the 'receive()' is a TCP receive from another JVM doing UDP input of a message and a TCP send to the 'receive()'. The operation is that a request is sent (via TCP) to the UDP side indicating that when a particular message is detected to send the detected message back. The message is sent via ...