WinRT: Only set keepalive socket option in certain socket states
The keepalive socket can only be set if the socket is not connected (see http://msdn.microsoft.com/en-us/library/ie/windows.networking.sockets.streamsocketcontrol.keepalive) Task-number: QTBUG-38623 Change-Id: Ia40dc66f071a8109538e4be7a8f420de81d5be8d Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Andrew Knight <andrew.knight@theqtcompany.com>
This commit is contained in:
parent
8920200c97
commit
451668d252
@ -1882,6 +1882,9 @@ bool QAbstractSocket::setSocketDescriptor(qintptr socketDescriptor, SocketState
|
||||
\since 4.6
|
||||
Sets the given \a option to the value described by \a value.
|
||||
|
||||
\note On Windows Runtime, QAbstractSocket::KeepAliveOption must be set
|
||||
before the socket is connected.
|
||||
|
||||
\sa socketOption()
|
||||
*/
|
||||
void QAbstractSocket::setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value)
|
||||
|
@ -998,7 +998,8 @@ bool QNativeSocketEnginePrivate::setOption(QAbstractSocketEngine::SocketOption o
|
||||
return true;
|
||||
}
|
||||
case QAbstractSocketEngine::KeepAliveOption: {
|
||||
if (socketType == QAbstractSocket::UdpSocket)
|
||||
if (socketType == QAbstractSocket::UdpSocket
|
||||
|| socketState != QAbstractSocket::UnconnectedState)
|
||||
return false;
|
||||
|
||||
boolean keepAlive = v;
|
||||
|
Loading…
Reference in New Issue
Block a user