1
Network / Re: Packets Arrive In Different Order When Non-Blocking Than When Blocking
« on: April 24, 2014, 08:23:53 am »
Thanks - I changed it to this:
It's something I have tried before with ineffective results, but I believe I discovered why I wrote this off as the cause - in my larger program, I made calls to both operator cin>> and std::getline(cin, string) sequentially, without clearing the buffer. Rookie mistake, but I just assumed it was your network module causing the problem. Sorry for the waste of your time!
if(socket.receive(dataPacket, senderIp, senderSocket)!=sf::Socket::NotReady)
{
string packetContents;
packetContents = getContents(dataPacket);
cout << "(Server) Heard " << packetContents << endl;
}
{
string packetContents;
packetContents = getContents(dataPacket);
cout << "(Server) Heard " << packetContents << endl;
}
It's something I have tried before with ineffective results, but I believe I discovered why I wrote this off as the cause - in my larger program, I made calls to both operator cin>> and std::getline(cin, string) sequentially, without clearing the buffer. Rookie mistake, but I just assumed it was your network module causing the problem. Sorry for the waste of your time!