What is the time out? Why not simply set it to 1 sec max?
It’s asynchronous so timeout is more for catching sockets that completely failed. 1 second is not sufficient.
But the problem on Windows is that if the first one fails it waits forever before sending a second (if at all)
I’d argue if it doesn’t work quickly then dump it and try the second.
Ideal? No. But possibly better than the current situation.
The article states it waits for ipv6 DNS query to respond before ipv4. This does NOT mean it prevents other Xojo.Net.HTTPSocket’s from asynchronously sending at the same time.
The “timeout” property is a Xojo construct designed to prevent a synchronous old style HTTPSocket from locking up the application forever.
Not much Xojo can do about how the underlying OS chooses to use DNS.
What they don’t mention in the blog article is the obvious solution: Use the IP address instead.
The problem is if you use the IP address and the server uses virtual hosts then the HTTP request will have the wrong host listed. One fix for this would be to allow you to override the Host property of the request while providing the IP to connect too.
It was considered actually, but with the push to do everything via https, you’ll start getting errors because of the cert mismatch. Turning off validation means that you no longer know that you connected to the right server, just that it connected securely to a server.
Well virtual hosts are utilized by the Host property in the first line of the request. You can make a TCP connection to an IP address and use whatever host you want. SNI should work fine in my experience.
That may be, but you can’t change the Host header on the new HTTPSocket at the moment.