Reworking connect method

Implements a hack to try to connect to every IP of a hostname, instead
of the default behaviour of trying all within a timeout.