C++ Stop ASIO from caching data

  boost-asio, c++

Hi I am writing an online multiplayer game in C++ using SFML and ASIO for networking. I was sending data back and forth between server and client and the server was sending the correct data but the client keeps acting as if it has received the same data. I have deduced this error to the fact that ASIO is caching the data. Data is and needs to be sent back and forth each frame.
If I send: {"Hello"} as my first message no matter what is sent after the client only sees this
To read the data on the client I am using the following code

asio::read_until(socket, buffer, TRAILER);
str_data=asio::buffer_cast<const char*>(buffer.data());

Thanks for any help in advance

Source: Windows Questions C++

LEAVE A COMMENT