LanLinkProvider: Bind the UDP server socket to Any, not Broadcast.
Trying to bind a UDP socket to 255.255.255.255 fails with EADDRNOTAVAIL at least on FreeBSD. The sender side on Android should send its message in broadcast mode (as it already does), but the receiver side should bind to INADDR_ANY, not INADDR_BROADCAST. BUG: 324769 REVIEW: 118870
This commit is contained in:
parent
5a91db4427
commit
2df8a8064f
1 changed files with 1 additions and 1 deletions
|
@ -68,7 +68,7 @@ LanLinkProvider::LanLinkProvider()
|
||||||
|
|
||||||
void LanLinkProvider::onStart()
|
void LanLinkProvider::onStart()
|
||||||
{
|
{
|
||||||
bool buildSucceed = mUdpServer->bind(QHostAddress::Broadcast, port, QUdpSocket::ShareAddress);
|
bool buildSucceed = mUdpServer->bind(QHostAddress::Any, port, QUdpSocket::ShareAddress);
|
||||||
Q_ASSERT(buildSucceed);
|
Q_ASSERT(buildSucceed);
|
||||||
|
|
||||||
mTcpPort = port;
|
mTcpPort = port;
|
||||||
|
|
Loading…
Reference in a new issue