summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/network/socket/qlocalsocket.cpp9
-rw-r--r--src/network/socket/qlocalsocket_win.cpp16
2 files changed, 9 insertions, 16 deletions
diff --git a/src/network/socket/qlocalsocket.cpp b/src/network/socket/qlocalsocket.cpp
index fba7f756633..a42b70546cd 100644
--- a/src/network/socket/qlocalsocket.cpp
+++ b/src/network/socket/qlocalsocket.cpp
@@ -208,7 +208,14 @@ QT_BEGIN_NAMESPACE
/*!
\fn void QLocalSocket::close()
- \reimp
+
+ Closes the I/O device for the socket and calls disconnectFromServer()
+ to close the socket's connection.
+
+ See QIODevice::close() for a description of the actions that occur when an I/O
+ device is closed.
+
+ \sa abort()
*/
/*!
diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp
index 5d0fdfb0238..229efe02268 100644
--- a/src/network/socket/qlocalsocket_win.cpp
+++ b/src/network/socket/qlocalsocket_win.cpp
@@ -377,21 +377,11 @@ bool QLocalSocket::canReadLine() const
void QLocalSocket::close()
{
Q_D(QLocalSocket);
- if (openMode() == NotOpen)
- return;
QIODevice::close();
d->serverName = QString();
d->fullServerName = QString();
-
- if (state() != UnconnectedState) {
- if (bytesToWrite() > 0) {
- disconnectFromServer();
- return;
- }
-
- d->_q_pipeClosed();
- }
+ disconnectFromServer();
}
bool QLocalSocket::flush()
@@ -481,10 +471,6 @@ bool QLocalSocket::waitForDisconnected(int msecs)
qWarning("QLocalSocket::waitForDisconnected() is not allowed in UnconnectedState");
return false;
}
- if (!openMode().testFlag(QIODevice::ReadOnly)) {
- qWarning("QLocalSocket::waitForDisconnected isn't supported for write only pipes.");
- return false;
- }
QDeadlineTimer deadline(msecs);
while (!d->pipeReader->isPipeClosed()) {