Hello,
First, thanks for this library and sorry if my question has an obvious / documented answer but I didn't find anything. Here is a code sample that recreates my issue (which is, getting a Disconnected socket status when calling socket.Receive(...) after socket.Send(...), even if I take a nap between the calls) :
sf::UdpSocket socket;
socket.bind(sf::Socket::AnyPort);
socket.setBlocking(false);
std::byte buffer[2000];
sf::IpAddress remoteIp = sf::IpAddress::LocalHost;
uint16_t remotePort = 42913;
size_t receivedSize;
assert(socket.getLocalPort() != remotePort);
std::this_thread::sleep_for(100ms);
// Status = Done
socket.send(buffer, 500, remoteIp, remotePort);
std::this_thread::sleep_for(100ms);
// Status = Disconnected
socket.receive(buffer, 1000, receivedSize, remoteIp, remotePort);
Maybe it has to do with sending the packet to myself, but it is very conveniant. Any idea ?