I've been using Udp and trying to find a way to handle cilents.
Right now I'm just using a vector of ip addresses to hold ips that send stuff (std::vector<sf::IpAddress> cilents)
(Snippet of code)
if(socket.receive(packet, new_cilent, port) != sf::Socket::NotReady){
std::cout << new_cilent << std::endl; //<-- This prints out actual ip address
if(cilents.empty()){
cilents.push_back(new_cilent);
std::cout << cilents[0] << std::endl; //<-- This prints out "0.0.0.0"
}
Are ip addresses unable to work with vectors or was it something wrong on my end?
Thanks!