[Qt-interest] unable to bind to limited broadcast on Mac (perror)

Bart Swinnen bart.swinnen at luminex.be
Tue Aug 11 14:16:22 CEST 2009


Hi

I'm unable to bind a udp socket to the limited broadcast address on Mac.
Using Qt4.5.2 sdk on Mac 10.4.11
Is there a way to find out what error code is returned from the OS? Is 
ti possible this address is already in use and locked by other socket on 
the system?
Can someone verify this problem and let me know if and how I can 
successfully bind the socket?

Here is code I use to bind:

m_udpSocket->bind(QHostAddress::Broadcast, m_udpPort);

I also tried with different options / combinations for reuse address etc.

The port number is not the problem as I can bind to the normal broadcast 
address and host address on that port without any problem.

with perror, I get:
Can't assign requested address

I also read on a BSD forum that the sockaddr has to be memset to 0 first 
to solve similar issue with POSIX C code

Any advise would be welcome

Kind regards



More information about the Qt-interest-old mailing list