// SetHTTPSPort sets the HTTPSPort field's value.
436239
func (s *CustomOriginConfig) SetHTTPSPort(v int64) *CustomOriginConfig {
	s.HTTPSPort = &v
	return s
}
832147
func (s *ConnectivityInfo) SetHostAddress(v string) *ConnectivityInfo {
	s.HostAddress = &v
	return s
}
1232959
func (c *Config) InitHTTPClient() {
	var emptySettings HTTPClientSettings

	if c.HTTPSettings == emptySettings { // User forgot to initialize the settings
		c.HTTPSettings = DefaultHTTPClientSettings
	} else {
		if c.HTTPSettings.ConnectTimeout == 0 {
			c.HTTPSettings.ConnectTimeout = DefaultHTTPClientSettings.ConnectTimeout
		}
		// If ReadTimeout and WriteTimeout is zero, means no read/write timeout
		if c.HTTPSettings.TLSHandshakeTimeout == 0 {
			c.HTTPSettings.TLSHandshakeTimeout = DefaultHTTPClientSettings.TLSHandshakeTimeout
		}
		if c.HTTPSettings.ExpectContinueTimeout == 0 {
			c.HTTPSettings.ExpectContinueTimeout = DefaultHTTPClientSettings.ExpectContinueTimeout
		}
	}
	dialer := utils.NewDialer(
		c.HTTPSettings.ConnectTimeout,
		c.HTTPSettings.ReadTimeout,
		c.HTTPSettings.WriteTimeout,
	)
	dialer.KeepAlive = c.HTTPSettings.TCPKeepAlive
	// XXX: DualStack enables RFC 6555-compliant "Happy Eyeballs" dialing
	// when the network is "tcp" and the destination is a host name
	// with both IPv4 and IPv6 addresses. This allows a client to
	// tolerate networks where one address family is silently broken
	dialer.DualStack = c.HTTPSettings.DualStack
	c.Connection = &http.Client{
		// We do not use the timeout in http client,
		// because this timeout is for the whole http body read/write,
		// it's unsuitable for various length of files and network condition.
		// We provide a wraper in utils/conn.go of net.Dialer to make io timeout to the http connection
		// for individual buffer I/O operation,
		Timeout: 0,
		Transport: &http.Transport{
			DialContext:           dialer.DialContext,
			MaxIdleConns:          c.HTTPSettings.MaxIdleConns,
			MaxIdleConnsPerHost:   c.HTTPSettings.MaxIdleConnsPerHost,
			IdleConnTimeout:       c.HTTPSettings.IdleConnTimeout,
			TLSHandshakeTimeout:   c.HTTPSettings.TLSHandshakeTimeout,
			ExpectContinueTimeout: c.HTTPSettings.ExpectContinueTimeout,
		},
	}
}
405391
func (s *CreateTargetGroupInput) SetHealthCheckPort(v string) *CreateTargetGroupInput {
	s.HealthCheckPort = &v
	return s
}
731147
func NetworkHostsPorts(hpm [][]HostPort) [][]network.HostPort {
	nhpm := make([][]network.HostPort, len(hpm))
	for i, hps := range hpm {
		nhpm[i] = NetworkHostPorts(hps)
	}
	return nhpm
}
1034879
func (s *DeleteIntegrationResponseInput) SetHttpMethod(v string) *DeleteIntegrationResponseInput {
	s.HttpMethod = &v
	return s
}
1035667
func (e *PodEndpoint) SetHostPort(port int) *PodEndpoint {
	e.HostPort = port
	return e
}
967175
func RequestTargetPort(req *http.Request) int {
	_, portStr, err := net.SplitHostPort(req.Host)
	if err == nil && portStr != "" {
		port, err := strconv.ParseInt(portStr, 0, 64)
		if err == nil {
			return int(port)
		}
	}
	if req.TLS != nil {
		return 443
	}
	return 80
}
159311
func (kc *HostKeyChecker) addrToHostPort(a string) (string, error) {
	if !strings.Contains(a, ":") {
		// No port, so return unadulterated
		return a, nil
	}
	host, p, err := net.SplitHostPort(a)
	if err != nil {
		log.Debugf("Unable to parse addr %s: %v", a, err)
		return "", err
	}

	port, err := strconv.Atoi(p)
	if err != nil {
		log.Debugf("Error parsing port %s: %v", p, err)
		return "", err
	}

	// Default port should be omitted from the entry.
	// (see `put_host_port` in openssh/misc.c)
	if port == 0 || port == sshDefaultPort {
		// IPv6 addresses must be enclosed in square brackets
		if strings.Contains(host, ":") {
			host = fmt.Sprintf("[%s]", host)
		}
		return host, nil
	}

	return fmt.Sprintf("[%s]:%d", host, port), nil
}
1238376
func fromNetworkHostPort(netHostPort network.HostPort) hostPort {
	return hostPort{
		Value:       netHostPort.Value,
		AddressType: string(netHostPort.Type),
		Scope:       string(netHostPort.Scope),
		Port:        netHostPort.Port,
		SpaceName:   string(netHostPort.SpaceName),
	}
}
331224
func (s *UpdateEndpointGroupInput) SetHealthCheckPort(v int64) *UpdateEndpointGroupInput {
	s.HealthCheckPort = &v
	return s
}
726177
func (s *DistributionSummary) SetHttpVersion(v string) *DistributionSummary {
	s.HttpVersion = &v
	return s
}
428470
func (hp *hostPort) networkHostPort() network.HostPort {
	return network.HostPort{
		Address: network.Address{
			Value:     hp.Value,
			Type:      network.AddressType(hp.AddressType),
			Scope:     network.Scope(hp.Scope),
			SpaceName: network.SpaceName(hp.SpaceName),
		},
		Port: hp.Port,
	}
}
705396
func (s *DeleteMethodResponseInput) SetHttpMethod(v string) *DeleteMethodResponseInput {
	s.HttpMethod = &v
	return s
}
706976
func (p *Packet) SourcePort() uint16 {
	if p.ipHdr.ipProto == IPProtocolTCP {
		return p.tcpHdr.sourcePort
	}

	return p.udpHdr.sourcePort
}
1347853
func (e TabletStats) GetTabletHostPort() string {
	vtPort := e.Tablet.PortMap["vt"]
	return netutil.JoinHostPort(e.Tablet.Hostname, vtPort)
}
229492
func (s *CreateDataSourceInput) SetHttpConfig(v *HttpDataSourceConfig) *CreateDataSourceInput {
	s.HttpConfig = v
	return s
}