Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2fce38c

Browse files
committed
Cliente en Java funcionando, aunque presenta problemas para conectarse desde computadoras diferentes al local-host
1 parent fb81020 commit 2fce38c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ThreadClient.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,15 @@ public void run()
105105
{
106106
System.out.println("Error enviando la señalización al servidor");
107107
e.printStackTrace();
108-
//this.alive = false;
109108
}
110109

111110

112111
if(finishFlag == 1)
113112
{
114113
// Terminar todo el hilo adecuadamente (cerrar la conexión)
115114
System.out.println("Cerrando la conexión");
116-
//this.alive = false;
115+
this.alive = false;
116+
break;
117117
}
118118
else if(dataFlag == 1)
119119
{
@@ -131,7 +131,7 @@ else if(dataFlag == 1)
131131
{
132132
System.out.println("Error enviando valores de setpoint");
133133
e.printStackTrace();
134-
//this.alive = false;
134+
break;
135135
}
136136
}
137137
dataFlag = 0;
@@ -150,15 +150,17 @@ else if(dataFlag == 1)
150150
{
151151
System.out.println("No se pudo hacer la lectura de la señal o la transferencia del finish");
152152
e.printStackTrace();
153+
break;
153154
//this.alive = false;
154155
}
155156
}
156157
//System.out.println("u_temp="+u_temp+" u_flow="+u_flow+" outemp="+out_temp+" outFlow="+out_flow+" time="+time_value);
157158
// Actualizar gráficos con los nuevos valores
158159
this.UpdateChart();
159160
}
160-
try
161-
{
161+
this.alive = false;
162+
try
163+
{
162164
System.out.println("Esperando para cerrar los sockets");
163165
Thread.sleep(4000);
164166
} catch (InterruptedException e1)

0 commit comments

Comments
 (0)