// SetConnListener is used to listen to new connections being made. The
// channel will be closed when the conn pool is closed or a new listener is set.
767399
func (p *ConnPool) SetConnListener(l chan<- *yamux.Session) {
	p.Lock()
	defer p.Unlock()

	// Close the old listener
	if p.connListener != nil {
		close(p.connListener)
	}

	// Store the new listener
	p.connListener = l
}
1176578
func (b *Broker) SetLocalConn(localConn *grpc.ClientConn) {
	b.mu.Lock()
	defer b.mu.Unlock()

	b.localConn = localConn
}
1315990
func NewListenerConn(name string, notificationChan chan<- *Notification) (*ListenerConn, error) {
	return newDialListenerConn(defaultDialer{}, name, notificationChan)
}
133987
func (hc *HealthCheckImpl) SetListener(listener HealthCheckStatsListener, sendDownEvents bool) {
	if hc.listener != nil {
		panic("must not call SetListener twice")
	}

	hc.mu.Lock()
	defer hc.mu.Unlock()
	if len(hc.addrToHealth) > 0 {
		panic("must not call SetListener after tablets were added")
	}

	hc.listener = listener
	hc.sendDownEvents = sendDownEvents
}
653515
func (s *HlsAkamaiSettings) SetConnectionRetryInterval(v int64) *HlsAkamaiSettings {
	s.ConnectionRetryInterval = &v
	return s
}
1287553
func (s *Statsd) tcpListen(listener *net.TCPListener) error {
	for {
		select {
		case <-s.done:
			return nil
		default:
			// Accept connection:
			conn, err := listener.AcceptTCP()
			if err != nil {
				return err
			}

			if s.TCPKeepAlive {
				if err = conn.SetKeepAlive(true); err != nil {
					return err
				}

				if s.TCPKeepAlivePeriod != nil {
					if err = conn.SetKeepAlivePeriod(s.TCPKeepAlivePeriod.Duration); err != nil {
						return err
					}
				}
			}

			select {
			case <-s.accept:
				// not over connection limit, handle the connection properly.
				s.wg.Add(1)
				// generate a random id for this TCPConn
				id := internal.RandomString(6)
				s.remember(id, conn)
				go s.handler(conn, id)
			default:
				// We are over the connection limit, refuse & close.
				s.refuser(conn)
			}
		}
	}
}
107761
func (s *CreateListenerOutput) SetListener(v *Listener) *CreateListenerOutput {
	s.Listener = v
	return s
}
555373
func (s *CancelArchivalInput) SetTapeARN(v string) *CancelArchivalInput {
	s.TapeARN = &v
	return s
}
245184
func (s *ListenerDescription) SetListener(v *Listener) *ListenerDescription {
	s.Listener = v
	return s
}
809744
func (s *GetConferenceProviderOutput) SetConferenceProvider(v *ConferenceProvider) *GetConferenceProviderOutput {
	s.ConferenceProvider = v
	return s
}
804194
func (s *RtmpOutputSettings) SetConnectionRetryInterval(v int64) *RtmpOutputSettings {
	s.ConnectionRetryInterval = &v
	return s
}
1067633
func TCPListener(port int) ListenConst {
	return func() (Listener, error) {
		listener, err := net.Listen("tcp", fmt.Sprintf(":%d", port))
		if err != nil {
			return nil, fmt.Errorf("Error binding to port %d: %v", port, err.Error())
		}
		return &tcpListener{listener: listener}, nil
	}
}
735291
func (s *HlsBasicPutSettings) SetConnectionRetryInterval(v int64) *HlsBasicPutSettings {
	s.ConnectionRetryInterval = &v
	return s
}
609033
func (s *GetConferenceProviderInput) SetConferenceProviderArn(v string) *GetConferenceProviderInput {
	s.ConferenceProviderArn = &v
	return s
}
908349
func (s *Connector) SetConnectorArn(v string) *Connector {
	s.ConnectorArn = &v
	return s
}
1256703
func (nc *Conn) SetErrorHandler(cb ErrHandler) {
	if nc == nil {
		return
	}
	nc.mu.Lock()
	defer nc.mu.Unlock()
	nc.Opts.AsyncErrorCB = cb
}
41623
func (s *Swarm) SetConnHandler(handler inet.ConnHandler) {
	s.connh.Store(handler)
}