packages.urllib3.util.connection

Module Contents

Functions

is_connection_dropped(conn) Returns True if the connection is dropped and should be closed.
create_connection(address,timeout=None,source_address=None,socket_options=None) Connect to address and return the socket object.
_set_socket_options(sock,options)
is_connection_dropped(conn)

Returns True if the connection is dropped and should be closed.

Parameters:connhttplib.HTTPConnection object.

Note: For platforms like AppEngine, this will always return False to let the platform handle connection recycling transparently for us.

create_connection(address, timeout=None, source_address=None, socket_options=None)

Connect to address and return the socket object.

Convenience function. Connect to address (a 2-tuple (host, port)) and return the socket object. Passing the optional timeout parameter will set the timeout on the socket instance before attempting to connect. If no timeout is supplied, the global default timeout setting returned by getdefaulttimeout() is used. If source_address is set it must be a tuple of (host, port) for the socket to bind as a source address before making the connection. An host of ‘’ or port 0 tells the OS to use the default.

_set_socket_options(sock, options)