// SetAfterConnectHandler registers a handler that is called
// after the client connects to the event server. This allows for
// custom code to be executed for a particular
// event client implementation.
503786
func (c *Client) SetAfterConnectHandler(h handler) {
	c.Lock()
	defer c.Unlock()
	c.afterConnect = h
}
266771
func (p *params) SetConnectionProvider(connProvider api.ConnectionProvider) {
	logger.Debugf("ConnectionProvider: %#v", connProvider)
	p.connProvider = connProvider
}
1317557
func (s *UpdateIntegrationInput) SetConnectionType(v string) *UpdateIntegrationInput {
	s.ConnectionType = &v
	return s
}
836579
func (s *DescribeVirtualInterfacesInput) SetConnectionId(v string) *DescribeVirtualInterfacesInput {
	s.ConnectionId = &v
	return s
}
863412
func (f FuncHttpsHandler) HandleConnect(host string, ctx *ProxyCtx) (*ConnectAction, string) {
	return f(host, ctx)
}
442792
func (s *CreateTransitVirtualInterfaceInput) SetConnectionId(v string) *CreateTransitVirtualInterfaceInput {
	s.ConnectionId = &v
	return s
}
576353
func (c *proxyConnection) SetConnection(conn net.Conn) {
	if c.conn != nil {
		log.WithField(fieldConn, c).Panic("Established connection is already associated")
	}

	c.conn = conn
	go c.writeQueuedMessages()
}
762456
func (s *Lag) SetConnections(v []*Connection) *Lag {
	s.Connections = v
	return s
}
892642
func (srv *Server) SetMessageHandler(handler func(message.MixMessage) *message.Reply) {
	srv.messageHandler = handler
}
456651
func (s *DescribeCommunicationsInput) SetAfterTime(v string) *DescribeCommunicationsInput {
	s.AfterTime = &v
	return s
}
981128
func (s *Swarm) SetSelectConn(cs SelectConn) {
	s.handlerLock.Lock()
	defer s.handlerLock.Unlock()
	s.selectConn = cs
}
1064011
func (b *DiskBuilder) SetEventHandler(event DiskBuildEvents, handler DiskBuildEventHandler) {
	b.buildEventHandlers[event] = handler
}
483124
func (ed *Dispatcher) HandleConnectEvent(e esdispatcher.Event) {
	evt := e.(*ConnectEvent)

	if ed.connection != nil {
		// Already connected. No error.
		evt.ErrCh <- nil
		return
	}

	eventch, err := ed.EventCh()
	if err != nil {
		evt.ErrCh <- err
		return
	}

	peers, err := ed.discoveryService.GetPeers()
	if err != nil {
		evt.ErrCh <- err
		return
	}

	if len(peers) == 0 {
		evt.ErrCh <- errors.New("no peers to connect to")
		return
	}

	peer, err := ed.peerResolver.Resolve(peers)
	if err != nil {
		evt.ErrCh <- err
		return
	}

	conn, err := ed.connectionProvider(ed.context, ed.chConfig, peer)
	if err != nil {
		logger.Warnf("error creating connection: %s", err)
		evt.ErrCh <- errors.WithMessagef(err, "could not create client conn")
		return
	}

	ed.connection = conn
	ed.setConnectedPeer(peer)

	go ed.connection.Receive(eventch)

	evt.ErrCh <- nil
}
4521
func (c *Client) callOnConnectHandlers() {
	c.m.RLock()
	defer c.m.RUnlock()

	for _, handler := range c.onConnectHandlers {
		func() {
			defer nopRecover()
			handler()
		}()
	}
}
431009
func (s *VirtualInterface) SetConnectionId(v string) *VirtualInterface {
	s.ConnectionId = &v
	return s
}
534301
func (s *UpdateIntegrationOutput) SetConnectionId(v string) *UpdateIntegrationOutput {
	s.ConnectionId = &v
	return s
}
126265
func (c *Client) OnDisconnect(handler func()) {
	c.m.Lock()
	c.onDisconnectHandlers = append(c.onDisconnectHandlers, handler)
	c.m.Unlock()
}