Network
This class receive all the packets from the server and add them in a queue
Public member functions
Network(std::string ip = "127.0.0.1", int port = 4242);
~Network();
void setInst(unsigned char inst);
Stream &getStreamOut();
void send(const Stream &stream);
void send();
void read();
void startReceive();
Queue<Network::Packet> &getQueueIn();
std::pair<size_t, Stream> getNextInst();
void setClosed(bool closed);Public attributes
std::thread _ReaderThread;Private attributes
std::string _ip;
int _port;
asio::io_context _ioContext;
asio::ip::udp::socket _socket;
asio::ip::udp::endpoint _serverEndpoint;
bool _closed;
Stream _streamOut;
unsigned char _instOut;
Stream _streamIn;
Queue<Network::Packet> _queueIn;Member functions documentation
Constructor
Parameters
setInst
getStreamOut
send
send
read
startReceive
getQueueIn
getNextInst
setClosed
Last updated