Re: UDP Communication issue
You can't. If it was possible, using firewalls wouldn't make sense because any application could have overriden it. The only thing you could do is to use a port that the firewall passes through like the HTTP port (TCP/80) but you need to have some mechanism that will proxy the traffic or you can set up a VPN connection but one way or another this requires a manual intervention somewhere.
Re: UDP Communication issue
Are you really sure ? Because I heard that it could work with some router.
And if I analyse with Wireshark (a network protocol analyzer) some application like Skype, I see that my PC can receive UDP socket without openning port.
Thanks you for your help
Re: UDP Communication issue
This method works with me and my co-developer :
Client side :
Code:
//Ecoute
connect(m_udpSocket, SIGNAL(readyRead()), this, SLOT(get()));
// ...
//Envoi
m_udpSocket->writeDatagram(datagram, *m_adresseServeur, m_port);
Serveur side:
Code:
//Ecoute
connect(m_udpSocket, SIGNAL(readyRead()), this, SLOT(get()));
// ...
//Envoi
m_udpSocket->writeDatagram(datagram, ipCLient, m_port);
You have to use the same port and the same socket to receive and to send.
Ok, problem is clear.
Re: UDP Communication issue
Hmm? No, you don't have to use the same port, that's a false assumption :)
Re: UDP Communication issue
Ok, but I don't succeed with a lot of other method and test, with two ports. Maybe you know what I have to do in the code to succeed.
Re: UDP Communication issue
In my opinion this is not a matter of your code but of the router that drops the transmission.
Re: UDP Communication issue
But is it better to use two ports ?
Re: UDP Communication issue
And this proves... what? Apart from the fact that you didn't bind the socket anywhere, of course...
Re: UDP Communication issue
Yes sorry, I saw and I edited my post ^^
Re: UDP Communication issue
It's not that it's better or worse. You can do as many ports as you wish and this won't make your transmission to be accepted or dropped by the router (unless of course it is configured to do so, but this only works on a case by case basis).
Re: UDP Communication issue
Ok thanks.
Until now I do my test on simple application. Now I do the modification on my real application (a FPS) :
remplace
Code:
m_udpSocket->writeDatagram(datagram, ipCLient, m_port);
instead of
Code:
udpSocket.writeDatagram(datagram, ipCLient, m_port);
and when the server or the client run the line m_udpSocket->writeDatagram(datagram, ipCLient, m_port); the application stop working.
Maybe you have an idea ? I tested to do waitForBytesWritten but it change nothing
Re: UDP Communication issue
I bet dollars against nuts that your socket object goes out of scope before any data has a chance to leave it (in the second case).