From b8453b6fe3552cdfe32c726f87bb30d897c679b0 Mon Sep 17 00:00:00 2001 From: Martin Petersson Date: Wed, 11 Jul 2012 12:31:29 +0200 Subject: QtNetwork: Handle FD_CLOSE on Windows We need to handle FD_CLOSE separately on Windows as this will be sent only once. When we get FD_CLOSE we need to check if there is more data available for reading. It there is this might indicate that there is another FD_READ that we need to handle after the FD_CLOSE. So in this case we will manually create another close event. Task-number: QTBUG-19409 Task-number: QTBUG-25386 Change-Id: Ie19906bc3f64fb6a85a508a5ab12caac5d70ccdb Reviewed-by: Shane Kearns --- src/corelib/kernel/qsocketnotifier.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/kernel/qsocketnotifier.cpp') diff --git a/src/corelib/kernel/qsocketnotifier.cpp b/src/corelib/kernel/qsocketnotifier.cpp index c108b967e20..98761098ee0 100644 --- a/src/corelib/kernel/qsocketnotifier.cpp +++ b/src/corelib/kernel/qsocketnotifier.cpp @@ -287,7 +287,7 @@ void QSocketNotifier::setEnabled(bool enable) bool QSocketNotifier::event(QEvent *e) { Q_D(QSocketNotifier); - // Emits the activated() signal when a QEvent::SockAct is + // Emits the activated() signal when a QEvent::SockAct or QEvent::SockClose is // received. if (e->type() == QEvent::ThreadChange) { if (d->snenabled) { @@ -297,7 +297,7 @@ bool QSocketNotifier::event(QEvent *e) } } QObject::event(e); // will activate filters - if (e->type() == QEvent::SockAct) { + if ((e->type() == QEvent::SockAct) || (e->type() == QEvent::SockClose)) { emit activated(d->sockfd); return true; } -- cgit v1.2.3