run function in thread class PROBLEM: I want control back to the outerloop when butn value is equal to "c" i used break statement to get control back to label outerloop but it's not working even though the butn is equal to c the control is not coming to outerloop and it is not printing "waiting for socket to connected"
public void run() {
try {
outerloop:
while (true) {
System.out.println("waiting for socket to connected");
sock2 = ss2.accept();
System.out.println("socket connected from download");
dis2 = new DataInputStream(sock2.getInputStream());
dos2 = new DataOutputStream(sock2.getOutputStream());
for(;;){
System.out.println("control is waiting @ line 291");
try{
butn = dis2.readUTF();
System.out.println("the butn pressed" + butn);
if (butn.equals("b")) {
browse();
}
if (butn.equals("c")) {
sock2.close();
dis2.close();
dos2.close();
jump outerloop;
}
if (butn.equals("g"))
{
getfile1();
}
}catch(Exception x){
x.printStackTrace();
}
}//for loop
}//while loop
} catch (Exception x) {
x.printStackTrace();
}
}//run
public void browse(){}
public void getfile1(){}
}