Last active
February 23, 2017 17:16
-
-
Save dawn360/334baa7cbedf93775fcef4189276d8e1 to your computer and use it in GitHub Desktop.
xmlrpc set timeout with custom transport
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http.client | |
import xmlrpc.client | |
class TimedTransport(xmlrpc.client.Transport): | |
timeout = 30 | |
def set_timeout(self, timeout): | |
self.timeout = timeout | |
def make_connection(self, host): | |
connection = http.client.HTTPConnection(host, timeout=self.timeout) | |
self._connection = host, connection | |
return connection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment