2 Commits

Author SHA1 Message Date
fc69790bd2 Code cleanup 2025-12-18 09:27:37 -05:00
6d87851117 Code cleanup 2025-12-16 18:23:21 -05:00
6 changed files with 9 additions and 7 deletions

View File

@@ -70,7 +70,7 @@ bool ClientSocketSender::sendFile(String &pathFileName)
sendPutIndicator(pathFileName, fileLength);
Array<char> readBuffer;
readBuffer.size(BUFFER_LENGTH);
std::cout << "Sending file " << pathFileName << Utility::byteCountToString(fileLength, false) << std::endl;
std::cout << "Sending file " << pathFileName << " " << Utility::byteCountToString(fileLength, false) << std::endl;
while(true)
{
size_t bytesRead = readFile.read(&readBuffer[0], readBuffer.size());

View File

@@ -11,6 +11,8 @@
// To Clean: From the top menu choose "View", "Command Palette", Then choose CMake: Clean OR /usr/bin/cmake --build /home/pi/CPP/sstp/build --config Debug --target clean --
// To Build: From the top menu choose "View", "Command Palette", Then choose CMake: Build OR /usr/bin/cmake --build /home/pi/CPP/sstp/build --config Debug --target all --
// Output will be here. /home/pi/CPP/sstp/build
// On Isonoe to receive we will point to the binaries here /home/pi/CPP/sstp/build
// On Adrastea we will point to the binaries here /home/pi/Boneyard/sstp
bool registerSignalHandler(void); // registers a Control-c handler
void signalHandler(int signal); // The Control-C handler
@@ -25,7 +27,7 @@ int main(int argc, char **argv)
{
int returnCode(0);
Profiler profiler;
String version = "1.0.0.7"; // major version, minor version, patch, build
String version = "1.0.0.9"; // major version, minor version, patch, build
std::cout << "sstp version " << version.str() << std::endl;
if(!registerSignalHandler())

View File

@@ -97,7 +97,7 @@ bool SocketConnectionReceiver::handlePut(Block<String> &commands)
fileName = commands[1];
fileLength = commands[commands.size()-1].toLong();
std::cout << "PUT" << " " << fileName << " " << Utility::byteCountToString(fileLength) << std::endl;
std::cout << "PUT" << " " << fileName << " " << Utility::byteCountToString(fileLength,false) << std::endl;
availableDiskSpace=Utility::getAvailableDiskSpace(String("./"));
std::cout << Utility::byteCountToString(availableDiskSpace,false) << " available space on disk" << std::endl;

View File

@@ -83,8 +83,8 @@ bool SocketServer::isOkay(void)
}
/// @brief This is the listener. It will wait for incoming connections.
/// When an incoming connection is received it will create a SocketConnectionReceiver object and call it's threadFunction to handle further interactions
/// such as transmitting a file.
/// When an incoming connection is received it will create a SocketConnectionReceiver object and call it's threadFunction
/// to handle further interactions such as transmitting a file.
void SocketServer::listen(void)
{
while(isOkay())

View File

@@ -6,7 +6,7 @@
#include <sstp/clientsocketsender.hpp>
/// @brief [0]=program [1]=SERVERMODE [2]={port}
/// @Note Currently this method will never return. The application is terminate with CTRL-C. Ideally, we would exit is some cleaner fashion
/// @Note Currently this method will never return. The application is terminated with CTRL-C. Ideally, we would exit in some cleaner fashion
/// perhaps by implementing a CTRL-C hook and then destroying the SocketServer properly by calling it's destructor. See SocketServer::~SocketServer()
/// @param commands
void SSTP::handleServer(Block<String>& commands)

View File

@@ -10,7 +10,7 @@ class SSTP
{
public:
SSTP();
~SSTP();
virtual ~SSTP();
void handleServer(Block<String>& arguments);
void handleClient(Block<String>& arguments);
private: