qt6-bb10/tests/auto/network/access/qnetworkreply
Mårten Nordheim 775a57f266 tst_QNetworkReply: Try to stabilize qtbug68821proxyError
The test is a bit silly, it was originally written to make sure that
we produce meaningful errors when trying to connect to a proxy server
where the connection is refused or the server doesn't respond at all.

To test that, it creates a local QTcpServer and starts listening to any
free port (by specifying port 0) and then it closed the server and
uses the address-port of localhost:serverPort as the proxy to use, since
we know it _was_ unused, since we were able to bind to it.

However, just calling close() doesn't immediately tear down the internal
socket descriptor, so the OS may still have the port reserved for
some time.

By moving the QTcpServer to a narrower scope we will quickly destroy it
and the internal socket engine, which is parented to the server, and
this in turn releases the socket descriptor.

Pick-to: 6.7 6.6 6.5
Change-Id: If12128fc21d1f545df152f08f0d52c1b14ac6037
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-15 16:27:19 +01:00
..
certs tst_qnetworkreply: replace server.pem/key pair 2022-07-15 22:42:43 +02:00
data QNetworkReply: Decompress when reading 2021-06-12 00:04:04 +02:00
echo Change license for tests files 2024-02-04 09:56:42 +01:00
test QtNetwork auto tests: compile with QT_NO_FOREACH 2023-08-22 21:50:38 +03:00
.gitattributes
.gitignore
4G.br QNetworkReply: Decompress when reading 2021-06-12 00:04:04 +02:00
BLACKLIST unblacklist passing tests 2022 2022-06-23 01:36:01 +02:00
CMakeLists.txt CMake: Make network tests standalone projects 2023-07-05 15:09:32 +02:00
bigfile
element.xml qnetworkreplyfileimpl: set attributes if file was sent 2015-05-04 11:20:40 +00:00
empty
image1.jpg
image2.jpg
image3.jpg
index.html
resource
rfc3252.txt
smb-file.txt
testserver_index.html Rework QNetworkReply tests to use docker-based test servers 2018-07-27 17:40:27 +00:00
tst_qnetworkreply.cpp tst_QNetworkReply: Try to stabilize qtbug68821proxyError 2024-02-15 16:27:19 +01:00