def connect(addr, port, metainfo, timeout = nil)
      ioInfo = startConnection(port, addr, metainfo)
      @ioInfo[ioInfo.io] = ioInfo
      if timeout && ioInfo.state == :connecting
        ioInfo.connectTimeout = timeout
        ioInfo.connectTimer = scheduleTimer(timeout, InternalTimerInfo.new(:connect_timeout, ioInfo), false)
      end
    end
def connect(addr, port, metainfo, timeout = nil)
      ioInfo = startConnection(port, addr, metainfo)
      @ioInfo[ioInfo.io] = ioInfo
      if timeout && ioInfo.state == :connecting
        ioInfo.connectTimeout = timeout
        ioInfo.connectTimer = scheduleTimer(timeout, InternalTimerInfo.new(:connect_timeout, ioInfo), false)
      end
    end
Create a TCP connection to the specified host.
 Note that this method may raise exceptions. For example 'Too many open files' might be raised if
 the process is using too many file descriptors