Hi All,
Using Qt SDK5.0.2. I am struggling a bit here with the QUdpSocket->bind() function on linux (in my case Ubuntu 12.10 and/or 10.10, I think version does not matter).
My project calls QUdpSocket->bind(ip_address, port);
I have built the project for windows and created a deployment (includnig all the dlls etc…). Then I run it on linux under wine and the binding fails. If I switch to root using “su” and run it again the binding works.
I then thought it was an issue of wine so I installed Qt SDK 5.0.2 on ubuntu 12.10. When I run the project via the Qt Creator its fine. But when I run the binary output from the command line (i.e. enter the command “./myapp”) it fails to bind. If I run as super user (i.e. enter the command “sudo ./myapp”) then it works.
The documentation says that the bind type “DontShareAddress” may need admin rights on certain platforms, so I tried using “QAbstractSocket::ShareAddress”. But this did not fix the problem.
Has anyone else come across this? I have not found much in the way of information on this topic so far.
Any ideas to solve this? – I don’t think my final solution is a good one if it has to be run as the root user.
Thanks very much :)
↧