This commit is contained in:
Mongolila-098
2026-04-28 13:35:36 +02:00
4 changed files with 59 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
package es.um.redes.nanoFiles.tcp.client;
package es.um.redes.nanoFiles.tcp.client;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -104,6 +104,13 @@ 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) {
@@ -129,6 +136,13 @@ public class NFConnector {
}
} catch (IOException e) { e.printStackTrace(); }
finally {
try {
socket.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return success;
}