mirror of
https://github.com/binlaab/nanofiles.git
synced 2026-07-01 13:37:22 +02:00
cosas varias
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user