def setFrozen(torrent, value)
      torrentData = torrent
      if ! torrent.is_a?(TorrentData)
        torrentData = @torrentData[torrent]
        if ! torrentData
          @logger.warn "Asked to freeze a non-existent torrent #{QuartzTorrent.bytesToHex(torrent)}"
          return
        end
      end

      if value
        # Disconnect from all peers so we won't reply to any messages.
        torrentData.peers.all.each do |peer|
          if peer.state != :disconnected
            # Close socket 
            withPeersIo(peer, "when removing torrent") do |io|
              setPeerDisconnected(peer)
              close(io)
            end
          end
          torrentData.peers.delete peer
        end
      else
        # Get our list of peers and start connecting right away
        # Non-recurring and immediate timer
        torrentData.managePeersTimer =
          @reactor.scheduleTimer(@managePeersPeriod, [:manage_peers, torrentData.infoHash], false, true)
      end
    end
def setFrozen(torrent, value)
      torrentData = torrent
      if ! torrent.is_a?(TorrentData)
        torrentData = @torrentData[torrent]
        if ! torrentData
          @logger.warn "Asked to freeze a non-existent torrent #{QuartzTorrent.bytesToHex(torrent)}"
          return
        end
      end

      if value
        # Disconnect from all peers so we won't reply to any messages.
        torrentData.peers.all.each do |peer|
          if peer.state != :disconnected
            # Close socket 
            withPeersIo(peer, "when removing torrent") do |io|
              setPeerDisconnected(peer)
              close(io)
            end
          end
          torrentData.peers.delete peer
        end
      else
        # Get our list of peers and start connecting right away
        # Non-recurring and immediate timer
        torrentData.managePeersTimer =
          @reactor.scheduleTimer(@managePeersPeriod, [:manage_peers, torrentData.infoHash], false, true)
      end
    end
Freeze or unfreeze a torrent. If value is true, then we disconnect from all peers for this torrent and forget
 the peers. If value is false, we start reconnecting to peers.
 Parameter torrent can be an infoHash or TorrentData