mirror of
https://github.com/binlaab/nanofiles.git
synced 2026-07-01 12:17:21 +02:00
arreglado ping y empezado peerdl y dirdl
This commit is contained in:
@@ -259,6 +259,7 @@ public class DirectoryConnector {
|
||||
byte[] resp = sendAndReceiveDatagrams(pingBytes);
|
||||
String respStr = new String(resp, 0, resp.length);
|
||||
DirMessage respPing = DirMessage.fromString(respStr);
|
||||
System.out.println("pingDir - " + respPing.getOperation());
|
||||
success = (respPing.getOperation().equals(DirMessageOps.OPERATION_PING_OK));
|
||||
|
||||
|
||||
@@ -355,9 +356,14 @@ public class DirectoryConnector {
|
||||
String filename = null;
|
||||
long filesize = -1;
|
||||
String filehash = null;
|
||||
|
||||
|
||||
|
||||
|
||||
FileInfo[] list = this.getFileList();
|
||||
FileInfo[] foundFile = FileInfo.lookupHashSubstring(list, hashSubstring);
|
||||
|
||||
// TODO: crear nuevo mensaje dirdl y requestdirdl
|
||||
// similar a un mensaje peerdl
|
||||
// pasarle hashSubstring a DirMessage y dejar que vaya desde ahí
|
||||
// implementar toda la lógica en DirMessage
|
||||
return new DownloadedFile(filename, filesize, fileData, filehash);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user