I just receive it simply (on the server) by doing that :
void createSocket(){
unsigned short bindPort = 12800;
unsigned short clientPort;
int ret = 0;
sf::UdpSocket socket;
sf::IpAddress clientAddr;
sf::Packet packet;
Map mainMap;
if (socket.bind(bindPort) != sf::Socket::Done){
if (sf::Socket::Error) std::cout << "An unexpected error happened : Fatal Error !" << std::endl;
if (sf::Socket::NotReady) std::cout << "The socket is not ready to send/receive data yet !" << std::endl;
}
std::cout << "The socket has been build and is ready to listen on port : " << bindPort << std::endl;
while(1){
packet.clear();
socket.receive(packet, clientAddr, clientPort);
std::cout << "A packet as been receive !" << std::endl;
std::string header = readFromPacket(packet);
ret = callFunction(packet, header, clientAddr, clientPort, mainMap, socket);
}
}
But again, as it is UDP socket, I don't see how the receive method I use on my server could influence the fact that I can't send an UDP packet on the client side.
port 12 800 is open on the server. I didn't open port on the client as I didn't do it with python when i worked with socket (it was working :/ )
Btw, I want to communicate over computer who are not on the same network. But if it was the case, why an address like 82.236 is bad ? It will just take a little more time, isn't it ?
Thanks,
Xavier