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

@@ -13,6 +13,9 @@
#include <common/profiler.hpp>
#include <common/block.hpp>
#include <common/fileio.hpp>
#include <common/pointer.hpp>
class SocketConnectionReceiver;
class SocketServer
{
@@ -24,11 +27,15 @@ class SocketServer
bool isOkay(void);
private:
static constexpr int MAX_CONNECTIONS=10; // The maximum connections to be queued at a time
void shutdownConnectionReceivers();
void join(void);
bool mIsOkay;
int mListenPort;
int mSocketFileDescriptor;
struct sockaddr_in mInternalSocketAddress;
socklen_t mAddressLength = sizeof(mInternalSocketAddress);
std::vector<std::thread> mExecutionThreads;
Block<SmartPointer<SocketConnectionReceiver>> mSocketConnectionReceivers;
};
#endif