Change project from listener to sstp

This commit is contained in:
2025-08-10 19:55:16 -04:00
parent b800c87df0
commit dc49c5c06b
46 changed files with 5830 additions and 21 deletions

34
sstp/socketserver.hpp Normal file
View File

@@ -0,0 +1,34 @@
#ifndef _LISTENER_SOCKETSERVER_HPP_
#define _LISTENER_SOCKETSERVER_HPP_
#include <stdio.h>
#include <iostream>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <thread>
#include <vector>
#include <common/string.hpp>
#include <common/profiler.hpp>
#include <common/block.hpp>
#include <common/fileio.hpp>
class SocketServer
{
public:
SocketServer(int port);
virtual ~SocketServer();
void listen(void);
void close(void);
bool isOkay(void);
private:
static constexpr int MAX_CONNECTIONS=10; // The maximum connections to be queued at a time
bool mIsOkay;
int mListenPort;
int mSocketFileDescriptor;
struct sockaddr_in mInternalSocketAddress;
socklen_t mAddressLength = sizeof(mInternalSocketAddress);
std::vector<std::thread> mExecutionThreads;
};
#endif