I want to abort a connection attempt after a certain total timeout (as opposed to individual timeouts for each step of the connection), because it makes sense to have high timeouts for individual round-trips, e.g. 30s, but it doesn’t make sense to have an overall timeout of X*30s with X being the number of overall round-trips during connection setup.
XMPPTCPConnection.connect() and then
.login() on a thread, and I want to re-use the connection after the failed connection attempt (as it might still hold XEP-0198 state).
However, both methods are synchronized, and the two potential methods to stop them (
.instantShutdown()) are synchronized as well, so they freeze until the connect/login has timed out.
Interrupting the Thread doesn’t yield the required result. Do I need to interrupt it multiple times?
How (else) can I abort the ongoing connection/login attempt in a timely fashion (let’s say within 100ms)?