Improve memory management

This commit is contained in:
2025-08-16 09:13:07 -04:00
parent 1da824d8cb
commit aef2d050f5
5 changed files with 82 additions and 8 deletions

View File

@@ -28,7 +28,7 @@ int main(int argc, char **argv)
{
int returnCode(0);
Profiler profiler;
String version = "1.00";
String version = "0.1.0.1"; // major version, minor version, patch, build
std::cout << "sstp version " << version.str() << std::endl;
try
@@ -78,6 +78,8 @@ int main(int argc, char **argv)
}
/// @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
/// perhaps by implementing a CTRL-C hook and then destroying the SocketServer properly by calling it's destructor. See SocketServer::~SocketServer()
/// @param commands
void handleServer(Block<String> &commands)
{
@@ -91,7 +93,7 @@ void handleServer(Block<String> &commands)
int port = commands[2].toInt();
std::cout << commands[1] << ":" << commands[2] << std::endl;
SocketServer socketServer(commands[2].toInt());
socketServer.listen();
socketServer.listen();
std::cout << "Done, total took " << Utility::formatNumber(profiler.end()) << "(ms)" << std::endl;
}