Commit a6ec8692 authored by Alex Trotsenko's avatar Alex Trotsenko
Browse files

Fix the spurious socket notifications under Windows


To handle network events, QEventDispatcherWin32 uses I/O model
based on notifications through the window message queue. Having
successfully posted notification of a particular event to an
application window, no further messages for that network event
will be posted to the application window until the application
makes the function call that implicitly re-enables notification
of that network event. With these semantics, an application need
not read all available data in response to an FD_READ message:
a single recv in response to each FD_READ message is appropriate.
If an application issues multiple recv calls in response to a
single FD_READ, it can receive multiple FD_READ messages
(including spurious).

To solve this issue, this patch always disables the notifier
after getting a notification, and re-enables it only when the
message queue is empty.

Task-number: QTBUG-46552
Change-Id: I05df67032911cd1f5927fa7912f7864bfbf8711e
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent 378e26dd
Showing with 153 additions and 79 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment