def connect_nonblock_finalize( sock, sockaddr )
      sock.connect_nonblock( sockaddr )
      return sock
    rescue Errno::EISCONN
      return sock
    rescue => ex
      raise Error, "Could not connect to #{host}:#{port}: #{ex.class}: #{ex.message}", ex.backtrace
    end
def connect_nonblock_finalize( sock, sockaddr )
      sock.connect_nonblock( sockaddr )
      return sock
    rescue Errno::EISCONN
      return sock
    rescue => ex
      raise Error, "Could not connect to #{host}:#{port}: #{ex.class}: #{ex.message}", ex.backtrace
    end
Internal: Make sure that a non-blocking connect has truely connected.

 Ensure that the given socket is actually connected to the given adddress.

 Returning the socket if it is and raising an Error if it isn't.