Hello.
My SFML-Network works fine on LAN but there is a problem connecting to remote host on the Internet. It seems that my code trying to send a packet immediately after the connection attempt (program needs more time to connect).
My code:
if(Client.Connect(7777, host)!=Socket::Done){
std::cout<<"Connection Error"<<std::endl;
}
Next goes the sending the first packet.
There is no problem with this code (print to 5000 delays my app for 3-4 seconds):
if(Client.Connect(7777, host)){
while(i<5000){
std::cout<<i<<std::endl;
i++;
}
}
How do I delay my program for the time needed to connect to remote host?