Reader

The reader class take an asio socket and receive all udp request from clients

Public member functions

Reader(asio::ip::udp::socket &socket, Queue<Reader::Packet> &queueIn, std::vector<std::shared_ptr<Client>> &clients);
~Reader();

Private member functions

//run the reader thread
void Clock();

Private attributes

std::thread _thread;
asio::io_context _ioContext;
asio::ip::udp::socket &_socket;
Queue<Reader::Packet> &_queueIn;
std::vector<std::shared_ptr<Client>> &_clients;

Member functions documentation

Constructor

Reader(asio::ip::udp::socket &socket, Queue<Reader::Packet> &queueIn, std::vector<std::shared_ptr<Client>> &clients);

Parameters

  • socket the asio socket where data come from

  • queueIn a refernce to the queue where all packet are stored

  • clients the vector that will contain all the client that send a request

Clock

Run an infinit clock that read every incoming datas

void Clock();

Last updated