However if you're opening a lot of connections at the same time, say in a multi-threaded application such as a HTTP server/handler, then it very easy to hit the SESSION_LIMIT. Control over closing the underlying connection is important in this scenario.
This PR makes the shutdown() method publicly callable. It also fixes the shutdown process to properly close the underlying TCP transport connection. Finally, it implements configurable connection and request timeouts
Electrumx does automatically close idle connections as per https://electrumx.readthedocs.io/en/latest/environment.html#envvar-SESSION_TIMEOUT
However if you're opening a lot of connections at the same time, say in a multi-threaded application such as a HTTP server/handler, then it very easy to hit the SESSION_LIMIT. Control over closing the underlying connection is important in this scenario.
This PR makes the
shutdown()
method publicly callable. It also fixes the shutdown process to properly close the underlying TCP transport connection. Finally, it implements configurable connection and request timeouts