code: func (h *hostportSyncer) cleanupHostportMap(containerPortMap map[*PortMapping]targetPod) {
  	// compute hostports that are supposed to be open
  	currentHostports := make(map[hostport]bool)
  	for containerPort := range containerPortMap {
  		hp := hostport{
  			port:     containerPort.HostPort,
  			protocol: strings.ToLower(string(containerPort.Protocol)),
  		}
  		currentHostports[hp] = true
  	}
  
  	// close and delete obsolete hostports
  	for hp, socket := range h.hostPortMap {
  		if _, ok := currentHostports[hp]; !ok {
  			socket.Close()
  			klog.V(3).Infof("Closed local port %s", hp.String())
  			delete(h.hostPortMap, hp)
  		}
  	}
  }
docs: // cleanupHostportMap closes obsolete hostports