21
Network / [Solved] UDP receive method not compiling
« Last post by Guido_Ion on May 06, 2025, 12:35:22 am »I'm following the tutorial Communicating with sockets for SFML 3.0 and I get this compiler error on the receive method
"no instance of overloaded function matches the argument list"
this is part of my code
It won't tell me which is the incorrect argument, maybe it's the sender that is now sf::optional?
Was the tutorial 3.0 for networking not updated from 2.5?
I have some years of experience in C++ and SFML but I'm new to networking.
"no instance of overloaded function matches the argument list"
this is part of my code
Code: [Select]
#define IP 191, 168, 1, 50
#define PORT 54000
...
sf::UdpSocket socket;
sf::IpAddress sender(IP); // I had to add the IP here because it gave me an error if I left it like in the tutorial
std::uint16_t x;
std::string s;
double d;
sf::Packet packet;
packet >> x >> s >> d;
...
if (socket.receive(packet, sender, PORT) != sf::Socket::Status::Done)
{
// error
}
It won't tell me which is the incorrect argument, maybe it's the sender that is now sf::optional?
Was the tutorial 3.0 for networking not updated from 2.5?
I have some years of experience in C++ and SFML but I'm new to networking.