for (std::deque<sf::TcpSocket*>::iterator it = clients.begin(); it != clients.end(); ++it)
{
sf::TcpSocket &client = **it;
if (selector.isReady(client))
{
// The client has sent some data, we can receive it
sf::Packet packet;
if (client.receive(packet) == sf::Socket::Done)
{
int aux = -50; //error code
packet >> aux;
cout << "Recieved - " << aux << " - from client with IP: " << client.getRemoteAddress();
}
else
{
cout << "this shit no worko\n";
}
}
else
{
cout << "selector no worko\n";
}
}