How will be a receive loop done in SFML?
This seems to be the wrong way:
char recvBuf[1024];
size_t received;
for (;;)
{
sf::Socket::Status status = client.Receive(recvBuf, sizeof(recvBuf), received);
if (status != sf::Socket::Done)
{
std::cerr << "Error: receive" << std::endl;
return 1;
}
if (received == 0)
break;
recvBuf[received] = '\0';
std::cout << "Server: " << recvBuf << std::endl;
}
How will it be done right in SFML?
Thanks,
Dummie