Hmm? No, you don't have to use the same port, that's a false assumption![]()
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.
In my opinion this is not a matter of your code but of the router that drops the transmission.
But is it better to use two ports ?
And this proves... what? Apart from the fact that you didn't bind the socket anywhere, of course...
Yes sorry, I saw and I edited my post ^^
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).
Ok thanks.
Until now I do my test on simple application. Now I do the modification on my real application (a FPS) :
remplace
instead ofQt Code:
m_udpSocket->writeDatagram(datagram, ipCLient, m_port);To copy to clipboard, switch view to plain text mode
Qt Code:
QUdpSocket udpSocket; udpSocket.writeDatagram(datagram, ipCLient, m_port);To copy to clipboard, switch view to plain text mode
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
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).
Bookmarks