I've got a few TcpSockets and a TcpListener in a selector. Why does this happen:
if (selector.isReady(client))
{
// The client has sent some data, we can receive it
std::cout << "Is ready\n";//Shows
sf::Packet packet;
int Status = client.receive(packet);
std::cout << "Status: " << Status << '\n';//Displays 1, aka Socket::NotReady
if (Status == sf::Socket::Done)
{
std::cout << "Message recieved!\n"; //Never happens
}
}
Shouldn't these values be the same? I'm using the SocketSelector example in the SFML 2.0 documentation. I am also using the latest git snapshot of SFML. One final thing: both the listener and all TcpSockets are NOT blocking.