diff options
author | Alex Trotsenko <alex1973tr@gmail.com> | 2016-07-28 17:28:27 +0300 |
---|---|---|
committer | Alex Trotsenko <alex1973tr@gmail.com> | 2016-08-04 15:25:39 +0000 |
commit | 595c6abf9d2cb666f2502bbf89ab3a7052717027 (patch) | |
tree | 468106b263d4712b400e08b5eb60993c431abe4f /src | |
parent | 457d91bb07a8ad0d1a582016566ba5119bb1ac95 (diff) |
QLocalSocket/Tcp: open device before making a connection
According to QLocalSocket's documentation, connectToServer() must
initiate a connection attempt after opening the device. Otherwise, if
a connection succeeds immediately, connected() signal will be emitted
on closed device. So, this patch ensures that TCP-based implementation
behaves correctly.
Change-Id: I4cc9474815e091a1491a429a6dc17f9cf0154f58
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/network/socket/qlocalsocket_tcp.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/socket/qlocalsocket_tcp.cpp b/src/network/socket/qlocalsocket_tcp.cpp index c0140e574e..461ece837f 100644 --- a/src/network/socket/qlocalsocket_tcp.cpp +++ b/src/network/socket/qlocalsocket_tcp.cpp @@ -239,8 +239,8 @@ void QLocalSocket::connectToServer(OpenMode openMode) QLatin1String("QLocalSocket::connectToServer")); return; } - d->tcpSocket->connectToHost(QHostAddress::LocalHost, port, openMode); QIODevice::open(openMode); + d->tcpSocket->connectToHost(QHostAddress::LocalHost, port, openMode); } bool QLocalSocket::setSocketDescriptor(qintptr socketDescriptor, |