Add timeout to Python class
This commit is contained in:
		@@ -36,6 +36,8 @@ class IPToGeo(object):
 | 
			
		||||
 | 
			
		||||
    def _create_socket(self):
 | 
			
		||||
        self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 | 
			
		||||
        if not self._timeout is None:
 | 
			
		||||
            self._socket.settimeout(self._timeout)
 | 
			
		||||
        self._socket.connect((self._remote_addr, self._remote_port))
 | 
			
		||||
 | 
			
		||||
    def _create_request(self, int_ip):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user