stuff-from-scratch/src/network/NetworkManager.h

34 lines
513 B
C
Raw Normal View History

2020-05-02 07:31:03 +00:00
#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>;