Fix QUdpSocket bindMode autotest regression
When binding with the DefaultForPlatform bindmode, then don't set options on the socket related to sharability, leave them at the platform default. This restores compatiblity with Qt 4 Change-Id: I612a3acb976f08446b4eef03ccdcdf84b3477c3c Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
This commit is contained in:
parent
b1a8a39d78
commit
7046188bc6
@ -1457,6 +1457,7 @@ bool QAbstractSocket::bind(const QHostAddress &address, quint16 port, BindMode m
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mode != DefaultForPlatform) {
|
||||
#ifdef Q_OS_UNIX
|
||||
if ((mode & ShareAddress) || (mode & ReuseAddressHint))
|
||||
d->socketEngine->setOption(QAbstractSocketEngine::AddressReusable, 1);
|
||||
@ -1473,6 +1474,7 @@ bool QAbstractSocket::bind(const QHostAddress &address, quint16 port, BindMode m
|
||||
else
|
||||
d->socketEngine->setOption(QAbstractSocketEngine::BindExclusively, 0);
|
||||
#endif
|
||||
}
|
||||
bool result = d->socketEngine->bind(address, port);
|
||||
d->cachedSocketDescriptor = d->socketEngine->socketDescriptor();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user