I found the solution by myself.
Posted By:
Sakibul_Khan
Posted On:
Sunday, April 6, 2003 07:14 PM
Hi,
I am posting my own solution for those who also have similar problems. Just close the socket connection & you get out of the while(true) because an exception is generated when a socket is blocked at "s.accept()" & you suddenly do "s.close()".
Hence, in the above code, I just made the "ServerSocket s" variable global insetad of local & added this extra line to "stop2()":-
s.close();
This will generate an exception in the "while()" of the run() method & caught by the "catch" after the "while".
---------------------------------SAKIB