code: func (h *hostportSyncer) openHostports(podHostportMapping *PodPortMapping) error {
  	var retErr error
  	ports := make(map[hostport]closeable)
  	for _, port := range podHostportMapping.PortMappings {
  		if port.HostPort <= 0 {
  			// Assume hostport is not specified in this portmapping. So skip
  			continue
  		}
  
  		// We do not open host ports for SCTP ports, as we agreed in the Support of SCTP KEP
  		if port.Protocol == v1.ProtocolSCTP {
  			continue
  		}
  
  		hp := hostport{
  			port:     port.HostPort,
  			protocol: strings.ToLower(string(port.Protocol)),
  		}
  		socket, err := h.portOpener(&hp)
  		if err != nil {
  			retErr = fmt.Errorf("cannot open hostport %d for pod %s: %v", port.HostPort, getPodFullName(podHostportMapping), err)
  			break
  		}
  		ports[hp] = socket
  	}
  
  	// If encounter any error, close all hostports that just got opened.
  	if retErr != nil {
  		for hp, socket := range ports {
  			if err := socket.Close(); err != nil {
  				klog.Errorf("Cannot clean up hostport %d for pod %s: %v", hp.port, getPodFullName(podHostportMapping), err)
  			}
  		}
  		return retErr
  	}
  
  	for hostPort, socket := range ports {
  		h.hostPortMap[hostPort] = socket
  	}
  
  	return nil
  }
docs: // openHostports opens all hostport for pod and returns the map of hostport and socket