I have multithreaded software that goes through TStringListHTTP URLs using the HTTPMethodobject method THTTPSend... However, an error occurred with proxies - less with good private proxies, more with bad public proxies. From time to time, several threads hang and become 100% unresponsive. The timeout value and code heartbeatwill be ignored; there will be no exceptions. No matter how long I wait (up to 10 minutes), the threads will still be hanging. Closing software was the only way to stop threads.
I found out that the incriminated method was SSL_Connect. From what I read, this hanging behavior can be fixed using non-blocking sockets ( openssl ssl_connect blocks forever - how to set a timeout? )
The fact is that Synapse is a blocking socket library. I could always use a non-blocking socket library for this small software, but I would like to use SSL for some of my larger programs. I cannot afford to change all my code for another online library, which is likely to have its own errors anyway.
How to set some timeout for SSL_Connectwhen using Synapse?
There is no code, because everything is very simple. These are TStringList looped URLs - nothing else! However, if you think this is necessary (or you need some other information), tell me.
Used Delphi: 2007
Synapse version used: Release 40 (2012) (Edit: An error still exists with the last boot of the SVN trunk.)
Used version of OpenSSL: 1.0.1e
source
share