Basically I am doing selective repeat protocol for java and I have multiple threads for doing this. I have a thread that sends and receives, but my code gets stuck on
socket.receive(packet);
I have a timer schedule:
Timer time = new Timer(true);
time.schedule(new Timeout (i) {}, timeOut)
The timer thread gets called correctly, and the timer thread is meant to interrupt the thread waiting on receive, but the interrupt call does nothing. Can a thread interrupt not stop a blocking socket receive call? If that is the case, what else can I do?