|
|
@ -123,7 +123,7 @@ public class ClientManagementTCP implements Runnable {
|
|
|
|
* @throws EmptyFile
|
|
|
|
* @throws EmptyFile
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void download(String filename) throws EmptyFile, NotFound, InternalError, UnknownHostException, IOException, TransmissionError, ProtocolError, VersionError, SizeError, InternalRemoteError, ProtocolRemoteError, VersionRemoteError {
|
|
|
|
private void download(String filename) throws EmptyFile, NotFound, InternalError, UnknownHostException, IOException, TransmissionError, ProtocolError, VersionError, SizeError, InternalRemoteError, ProtocolRemoteError, VersionRemoteError {
|
|
|
|
final long MAX_PARTIAL_SIZE = 1024;
|
|
|
|
final long MAX_PARTIAL_SIZE = 4096;
|
|
|
|
ProtocolP2PPacketTCP d = new ProtocolP2PPacketTCP((Payload) new LoadRequest(filename, 0, MAX_PARTIAL_SIZE));
|
|
|
|
ProtocolP2PPacketTCP d = new ProtocolP2PPacketTCP((Payload) new LoadRequest(filename, 0, MAX_PARTIAL_SIZE));
|
|
|
|
d.sendRequest((Object)socket);
|
|
|
|
d.sendRequest((Object)socket);
|
|
|
|
boolean fileFullyWritten = false;
|
|
|
|
boolean fileFullyWritten = false;
|
|
|
@ -188,6 +188,7 @@ public class ClientManagementTCP implements Runnable {
|
|
|
|
throw new ProtocolError();
|
|
|
|
throw new ProtocolError();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} while(!fileFullyWritten);
|
|
|
|
} while(!fileFullyWritten);
|
|
|
|
|
|
|
|
socket.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** list server’s directory content
|
|
|
|
/** list server’s directory content
|
|
|
|