Guys, I am in a situation :
I have a Socket application which creates Threads of Socket Servers listening to each port on request. On each request I create a
thread which will listen to a port in infinite loop ( like while(boolean var) ). But I have to address a situation in which a stop request will come for a port listener which needs to be processed. I need a reference to the active thread already created by which i can alter the boolean variable which causes infinite looping in respective threads. Guys , Please help me out how to achieve this.
PS : if my approach is wrong kindly pump in some ideas of achieving this.