33 lines
513 B
C++
33 lines
513 B
C++
#pragma once
|
|
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
#include "Socket.h"
|
|
#include "UnixSocketInterface.h"
|
|
|
|
class NetworkManager
|
|
{
|
|
std::vector<SocketPtr> mActiveSockets;
|
|
UnixSocketInterfacePtr mSocketInterface;
|
|
|
|
public:
|
|
|
|
NetworkManager();
|
|
|
|
~NetworkManager();
|
|
|
|
static std::shared_ptr<NetworkManager> Create();
|
|
|
|
void Initialize();
|
|
|
|
void OpenSocket(SocketPtr socket);
|
|
|
|
void CloseSocket(SocketPtr socket);
|
|
|
|
void RunHttpServer();
|
|
|
|
void ShutDown();
|
|
};
|
|
|
|
using NetworkManagerPtr = std::shared_ptr<NetworkManager>;
|