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

Skip to content

Commit 90fa45c

Browse files
committed
Cliente en Java funcionando correctamente, aún no trabaja bien con un servidor remoto pero funciona adecuadamente trabajando con el localhost
1 parent 2fce38c commit 90fa45c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

ThreadClient.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
public class ThreadClient extends Thread
1111
{
12-
private final int SERVER_PORT = 9090;
12+
private final int SERVER_PORT = 3385;
1313
public int dataFlag;
1414
public int finishFlag;
1515
private Window gui;
@@ -81,7 +81,7 @@ public void run()
8181
try
8282
{
8383
this.SERVER_IP = this.gui.txt_server_ip.getText();
84-
socket = new Socket(SERVER_IP, SERVER_PORT);
84+
socket = new Socket(this.SERVER_IP, SERVER_PORT);
8585
out = new DataOutputStream(socket.getOutputStream());
8686
in = new DataInputStream(socket.getInputStream());
8787
}
@@ -91,8 +91,8 @@ public void run()
9191
e.printStackTrace();
9292
this.alive = false;
9393
}
94-
95-
94+
95+
9696
while(this.alive)
9797
{
9898
// Enviar Finish y Data Flags
@@ -106,8 +106,8 @@ public void run()
106106
System.out.println("Error enviando la señalización al servidor");
107107
e.printStackTrace();
108108
}
109-
110-
109+
110+
111111
if(finishFlag == 1)
112112
{
113113
// Terminar todo el hilo adecuadamente (cerrar la conexión)
@@ -151,10 +151,9 @@ else if(dataFlag == 1)
151151
System.out.println("No se pudo hacer la lectura de la señal o la transferencia del finish");
152152
e.printStackTrace();
153153
break;
154-
//this.alive = false;
155154
}
156155
}
157-
//System.out.println("u_temp="+u_temp+" u_flow="+u_flow+" outemp="+out_temp+" outFlow="+out_flow+" time="+time_value);
156+
System.out.println("u_temp="+u_temp+" u_flow="+u_flow+" outemp="+out_temp+" outFlow="+out_flow+" time="+time_value+" setTemp="+setpoint_temp+" setFlow="+setpoint_flow);
158157
// Actualizar gráficos con los nuevos valores
159158
this.UpdateChart();
160159
}

0 commit comments

Comments
 (0)