Enhancements

This commit is contained in:
2025-08-14 17:32:16 -04:00
parent 8b4769bf7e
commit f441b186b5
3 changed files with 58 additions and 36 deletions

View File

@@ -105,13 +105,13 @@ bool SocketConnectionReceiver::handlePut(Block<String> &commands)
{
double elapsedTimeSeconds = profiler.elapsed()/1000.00;
double bytesPerSecond = totalBytesRead / elapsedTimeSeconds;
String strBytesPerSecond = Utility::bytesTransferredToString(bytesPerSecond);
std::cout << "Transferred " << Utility::formatNumber(totalBytesRead) << " of " << Utility::formatNumber(fileLength) << " " << percent << " percent " << strBytesPerSecond << std::endl;
String strBytesPerSecond = Utility::byteCountToString(bytesPerSecond);
std::cout << "Transferred " << Utility::byteCountToString(totalBytesRead,false) << " of " << Utility::byteCountToString(fileLength,false) << " " << percent << " percent " << strBytesPerSecond << std::endl;
}
}
std::cout << "Transfer complete" << std::endl;
std::cout << "Received " << Utility::formatNumber(totalBytesRead) << " in " << Utility::formatNumber(profiler.end()) << "(ms)" << std::endl;
std::cout << "Received " << Utility::byteCountToString(totalBytesRead,false) << " in " << Utility::formatNumber(profiler.end()) << "(ms)" << std::endl;
writeFile.close();
return totalBytesRead==fileLength;
}
@@ -128,7 +128,7 @@ size_t SocketConnectionReceiver::expectPacket(void)
sb.append("Received an invalid PCKT command");
String str=sb.toString();
std::cout << str << std::endl;
throw new InvalidOperationException(str);
throw InvalidOperationException(str);
}
if(!(subCommands[0]=="PCKT"))
{
@@ -138,7 +138,7 @@ size_t SocketConnectionReceiver::expectPacket(void)
sb.append("Expected PCKT but received ").append(subCommands[0]);
String str = sb.toString();
std::cout << str << std::endl;
throw new InvalidOperationException(str);
throw InvalidOperationException(str);
}
size_t bufferLength = subCommands[1].toULong();
return bufferLength;