// SetListeners sets the Listeners field's value.
174196
func (s *VirtualNodeSpec) SetListeners(v []*Listener) *VirtualNodeSpec {
	s.Listeners = v
	return s
}
1309673
func (s *DescribeRulesInput) SetListenerArn(v string) *DescribeRulesInput {
	s.ListenerArn = &v
	return s
}
487581
func (s *DescribeListenerOutput) SetListener(v *Listener) *DescribeListenerOutput {
	s.Listener = v
	return s
}
965349
func (s *Record) SetValues(v []*Value) *Record {
	s.Values = v
	return s
}
107761
func (s *CreateListenerOutput) SetListener(v *Listener) *CreateListenerOutput {
	s.Listener = v
	return s
}
891995
func (s *DescribeEventsOutput) SetEvents(v []*EventDescription) *DescribeEventsOutput {
	s.Events = v
	return s
}
213481
func (s *DescribeServicesOutput) SetServices(v []*Service) *DescribeServicesOutput {
	s.Services = v
	return s
}
700358
func (p *Pod) SetLabels(labels map[string]string) *Pod {
	p.Labels = labels
	return p
}
279589
func (s *PollForDecisionTaskOutput) SetEvents(v []*HistoryEvent) *PollForDecisionTaskOutput {
	s.Events = v
	return s
}
175459
func initListeners(amgr *addrmgr.AddrManager, listenAddrs []string, services wire.ServiceFlag) ([]net.Listener, NAT, error) {
	// Listen for TCP connections at the configured addresses
	netAddrs, err := parseListeners(listenAddrs)
	if err != nil {
		return nil, nil, err
	}

	listeners := make([]net.Listener, 0, len(netAddrs))
	for _, addr := range netAddrs {
		listener, err := net.Listen(addr.Network(), addr.String())
		if err != nil {
			srvrLog.Warnf("Can't listen on %s: %v", addr, err)
			continue
		}
		listeners = append(listeners, listener)
	}

	var nat NAT
	if len(cfg.ExternalIPs) != 0 {
		defaultPort, err := strconv.ParseUint(activeNetParams.DefaultPort, 10, 16)
		if err != nil {
			srvrLog.Errorf("Can not parse default port %s for active chain: %v",
				activeNetParams.DefaultPort, err)
			return nil, nil, err
		}

		for _, sip := range cfg.ExternalIPs {
			eport := uint16(defaultPort)
			host, portstr, err := net.SplitHostPort(sip)
			if err != nil {
				// no port, use default.
				host = sip
			} else {
				port, err := strconv.ParseUint(portstr, 10, 16)
				if err != nil {
					srvrLog.Warnf("Can not parse port from %s for "+
						"externalip: %v", sip, err)
					continue
				}
				eport = uint16(port)
			}
			na, err := amgr.HostToNetAddress(host, eport, services)
			if err != nil {
				srvrLog.Warnf("Not adding %s as externalip: %v", sip, err)
				continue
			}

			err = amgr.AddLocalAddress(na, addrmgr.ManualPrio)
			if err != nil {
				amgrLog.Warnf("Skipping specified external IP: %v", err)
			}
		}
	} else {
		if cfg.Upnp {
			var err error
			nat, err = Discover()
			if err != nil {
				srvrLog.Warnf("Can't discover upnp: %v", err)
			}
			// nil nat here is fine, just means no upnp on network.
		}

		// Add bound addresses to address manager to be advertised to peers.
		for _, listener := range listeners {
			addr := listener.Addr().String()
			err := addLocalAddress(amgr, addr, services)
			if err != nil {
				amgrLog.Warnf("Skipping bound address %s: %v", addr, err)
			}
		}
	}

	return listeners, nat, nil
}
672426
func (s *GetApplicationOutput) SetLabels(v []*string) *GetApplicationOutput {
	s.Labels = v
	return s
}
1016881
func (s *DescribeListenerInput) SetListenerArn(v string) *DescribeListenerInput {
	s.ListenerArn = &v
	return s
}
1087498
func (a *DispatchMouseEventArgs) SetButtons(buttons int) *DispatchMouseEventArgs {
	a.Buttons = &buttons
	return a
}
300457
func (s *UpdateApplicationOutput) SetLabels(v []*string) *UpdateApplicationOutput {
	s.Labels = v
	return s
}
66110
func (s *DeviceInstance) SetLabels(v []*string) *DeviceInstance {
	s.Labels = v
	return s
}
795294
func (s *DescribeEntityAggregatesInput) SetEventArns(v []*string) *DescribeEntityAggregatesInput {
	s.EventArns = v
	return s
}
1304296
func (s *CreateFunctionDefinitionVersionInput) SetFunctions(v []*Function) *CreateFunctionDefinitionVersionInput {
	s.Functions = v
	return s
}