def readWithTimeout(socket, length, timeout)
      rc = IO.select([socket], nil, nil, timeout)
      if ! rc
        raise "Waiting for response from UDP tracker #{@host}:#{@trackerPort} timed out after #{@timeout} seconds"
      elsif rc[0].size > 0
        socket.recvfrom(length)[0]
      else
        raise "Error receiving response from UDP tracker #{@host}:#{@trackerPort}"
      end
    end
def readWithTimeout(socket, length, timeout)
      rc = IO.select([socket], nil, nil, timeout)
      if ! rc
        raise "Waiting for response from UDP tracker #{@host}:#{@trackerPort} timed out after #{@timeout} seconds"
      elsif rc[0].size > 0
        socket.recvfrom(length)[0]
      else
        raise "Error receiving response from UDP tracker #{@host}:#{@trackerPort}"
      end
    end
Throws exception if timeout occurs