Forum de la communauté SFML
Aide => Général => Discussion démarrée par: s1and1 le Décembre 29, 2021, 08:29:33 pm
-
Hello, I'm trying to create a thread that takes an instance of the sf::Packet class as an argument, but everything is mixed up there.
sf::UdpSocket sock;
void server(sf::Packet pack, sf::Address addr, sf::Packet packet){
int a;
pack >> a;
std::cout<<a;
}
int main(){
sf::Address addr;
sf::Packet packet;
unsigned short port;
sock.bind(19132);
sock.receive(packet, addr, port);
std::thread thr(server, packet, addr, port);
thr.detach();
}
-
French forums again.
>>> (https://en.sfml-dev.org/forums/Themes/ds-natural_20/images/custom/en-icon.png) english (https://en.sfml-dev.org/forums/) (https://en.sfml-dev.org/forums/Themes/ds-natural_20/images/custom/en-icon.png) <<<