From 04c518e7629945a48e7e8e9216229cc879055ff4 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 10 Sep 2009 17:46:11 +0200 Subject: QLocalSocket Windows: emit readChannelFinished if broken pipe detected If we detect in a read operation that the pipe has been closed, we must emit the readChannelFinished signal. Reviewed-by: ossi --- src/network/socket/qlocalsocket_win.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp index ea85a62..93e0958 100644 --- a/src/network/socket/qlocalsocket_win.cpp +++ b/src/network/socket/qlocalsocket_win.cpp @@ -265,6 +265,8 @@ void QLocalSocketPrivate::startAsyncRead() // It may happen, that the other side closes the connection directly // after writing data. Then we must set the appropriate socket state. pipeClosed = true; + Q_Q(QLocalSocket); + emit q->readChannelFinished(); return; } default: @@ -326,6 +328,7 @@ DWORD QLocalSocketPrivate::bytesAvailable() } else { if (!pipeClosed) { pipeClosed = true; + emit q->readChannelFinished(); QTimer::singleShot(0, q, SLOT(_q_pipeClosed())); } } @@ -448,6 +451,7 @@ void QLocalSocketPrivate::_q_notified() Q_Q(QLocalSocket); if (!completeAsyncRead()) { pipeClosed = true; + emit q->readChannelFinished(); return; } startAsyncRead(); -- cgit v0.12