This commit is contained in:
Mongolila-098
2026-04-29 18:31:15 +02:00
3 changed files with 32 additions and 21 deletions

View File

@@ -43,11 +43,16 @@ public class NFConnector {
} catch (Exception e) { e.printStackTrace(); }
dis = new DataInputStream(socket.getInputStream());
dos = new DataOutputStream(socket.getOutputStream());
}
public void close() {
try {
socket.close();
} catch (IOException e) {
e.printStackTrace();
}
}
public void test() {
/*
* done: (Boletín SocketsTCP) Enviar entero cualquiera a través del socket y
@@ -104,13 +109,6 @@ public class NFConnector {
System.out.println("Nos vamos de gfl");
return filelist.toArray(new FileInfo[0]);
} catch (IOException e) { e.printStackTrace(); return null; }
finally {
try {
socket.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public boolean downloadChunk(String hash, int chunkNum, RandomAccessFile raf) {
@@ -136,13 +134,6 @@ public class NFConnector {
}
} catch (IOException e) { e.printStackTrace(); }
finally {
try {
socket.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return success;
}