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

Windows socket engine: do not discard datagram on critical failure


On some network conditions, WSARecvFrom() may return WSAECONNRESET
or WSAENETRESET error code to indicate that the connection has been
broken and should be reset. According to MSDN documentation,
WSAECONNRESET mean that the virtual circuit was reset by the remote
side executing a hard or abortive close. Also, it would indicate
that a previous send operation resulted in an ICMP "Port Unreachable"
message. For a datagram socket, WSAENETRESET indicates that the time
to live has expired.

Previously, hasPendingDatagram() discarded datagrams with these
errors and reported no data available. This behavior is incorrect
and can lead to infinite "freezing" of the socket.

This patch allows to handle these notifications as a result of the
readDatagram() call.

Task-number: QTBUG-46552
Change-Id: I7d84babe22d36736b928b4dd4841e30be53d16bd
Reviewed-by: default avatarKai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent a6ec8692
No related merge requests found
Showing with 21 additions and 16 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