So is it truly blocking? Are you constantly receiving data?
OK, I remembered that the server I wrote sends the packets it receives to every
other client.
for (unsigned int i = 0; i < Clients.size(); i++)
{
if (Selector.isReady(*Clients[i]))
{
sf::Packet packet;
if (Clients[i]->receive(packet) == sf::Socket::Done)
{
for (unsigned int j = 0; j < Clients.size(); j++)
{
if (i != j) { Clients[j]->send(packet); }
}
}
}
}
... and upon connecting another client to the server, both clients were using only 1 percent CPU as expected.
So, I guess they have to be constantly receiving data or sf::TcpSocket::receive goes nuts?
Sorry for being a noob, still very new to this network voodoo.