I have another question (didn't want to make another topic for it to avoid flooding the forums
). For some reason my server only accepts one packet from each client.
I have this code in the server file:
while(true)
{
sf::Packet packet;
if(client_one->receive(packet) == sf::Socket::Done)
{
std::string s;
packet >> s;
std::cout << "CLIENT_ONE: " << s << std::endl;
}
if(client_two->receive(packet) == sf::Socket::Done)
{
std::string s;
packet >> s;
std::cout << "CLIENT_TWO: " << s << std::endl;
}
}
Which recieves the first packet from each client, but no packets which are sent later. Debugging the application seems to indicate the while(true) ends somehow! What could be the issue?