I\'m trying to stop a thread but I can\'t do that :
public class Middleware { public void read() { try { socket = new Socket(\"192.168.1.8\", 20
if you want to interrupt a running thread, then you need to have access to the thread object.
thread = new Thread(scan); thread.start();
then say
thread.interrupt();
this will interrupt the running thread.