Change project from listener to sstp
This commit is contained in:
34
sstp/socketserver.hpp
Normal file
34
sstp/socketserver.hpp
Normal 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
|
||||
Reference in New Issue
Block a user