I have the following piece of code in Java:
Please, take a look to this answer where is shown how to set
It results from documentation that
setConnectTimeout are the same things in Python.
Note that the
connect()operation is subject to the timeout setting, and in general it is recommended to call
connect()or pass a timeout parameter to
create_connection(). The system network stack may return a connection timeout error of its own regardless of any Python socket timeout setting.