// ConnectedServer mocks base method
548331
func (m *MockInstanceConnector) ConnectedServer() string {
	ret := m.ctrl.Call(m, "ConnectedServer")
	ret0, _ := ret[0].(string)
	return ret0
}
1129790
func (ks *JavaServerSelector) AddServer(server string) error {
	addr, keys, err := ks.prepServer(server)
	if err != nil {
		return err
	}

	ks.lock.Lock()
	defer ks.lock.Unlock()
	for _, key := range keys {
		k := hash(key)
		ks.ring = append(ks.ring, info{
			hash: k,
			addr: addr,
		})
	}

	sort.Sort(ks.ring)
	ks.addrs = append(ks.addrs, addr)

	return nil
}
504698
func (s *HTTPServer) ConnectCAConfiguration(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
	switch req.Method {
	case "GET":
		return s.ConnectCAConfigurationGet(resp, req)

	case "PUT":
		return s.ConnectCAConfigurationSet(resp, req)

	default:
		return nil, MethodNotAllowedError{req.Method, []string{"GET", "POST"}}
	}
}
771041
func (ed *Dispatcher) HandleConnectedEvent(e esdispatcher.Event) {
	evt := e.(*ConnectedEvent)

	logger.Debugf("Handling connected event: %+v", evt)

	if ed.connectionRegistration != nil && ed.connectionRegistration.Eventch != nil {
		select {
		case ed.connectionRegistration.Eventch <- NewConnectionEvent(true, nil):
		default:
			logger.Warn("Unable to send to connection event channel.")
		}
	}

	if ed.peerMonitorPeriod > 0 {
		ed.peerMonitorDone = make(chan struct{})
		go ed.monitorPeer(ed.peerMonitorDone)
	}
}
266047
func (e *etcdClient) Connected() <-chan struct{} {
	select {
	case <-e.firstSession:
		out := make(chan struct{})
		go func() {
		getSession:
			e.RLock()
			ch := e.session.Done()
			e.RUnlock()
			select {
			case <-ch:
				// this case means we are disconnected as the e.session.Done() was
				// closed. We will polling until we have a new etcd session and
				// we are connected to the kvstore.
				time.Sleep(100 * time.Millisecond)
				goto getSession
			default:
				close(out)
			}
		}()
		return out
	default:
		// We assume when the e.firstSession is closed that we have connectivity
		// with the kvstore as this channel is closed when we have the first
		// session.
		return e.firstSession
	}
}
286385
func ConnectObject(disp *ole.IDispatch, iid *ole.GUID, idisp interface{}) (cookie uint32, err error) {
	unknown, err := disp.QueryInterface(ole.IID_IConnectionPointContainer)
	if err != nil {
		return
	}

	container := (*ole.IConnectionPointContainer)(unsafe.Pointer(unknown))
	var point *ole.IConnectionPoint
	err = container.FindConnectionPoint(iid, &point)
	if err != nil {
		return
	}
	if edisp, ok := idisp.(*ole.IUnknown); ok {
		cookie, err = point.Advise(edisp)
		container.Release()
		if err != nil {
			return
		}
	}
	rv := reflect.ValueOf(disp).Elem()
	if rv.Type().Kind() == reflect.Struct {
		dest := &stdDispatch{}
		dest.lpVtbl = &stdDispatchVtbl{}
		dest.lpVtbl.pQueryInterface = syscall.NewCallback(dispQueryInterface)
		dest.lpVtbl.pAddRef = syscall.NewCallback(dispAddRef)
		dest.lpVtbl.pRelease = syscall.NewCallback(dispRelease)
		dest.lpVtbl.pGetTypeInfoCount = syscall.NewCallback(dispGetTypeInfoCount)
		dest.lpVtbl.pGetTypeInfo = syscall.NewCallback(dispGetTypeInfo)
		dest.lpVtbl.pGetIDsOfNames = syscall.NewCallback(dispGetIDsOfNames)
		dest.lpVtbl.pInvoke = syscall.NewCallback(dispInvoke)
		dest.iface = disp
		dest.iid = iid
		cookie, err = point.Advise((*ole.IUnknown)(unsafe.Pointer(dest)))
		container.Release()
		if err != nil {
			point.Release()
			return
		}
		return
	}

	container.Release()

	return 0, ole.NewError(ole.E_INVALIDARG)
}
1232484
func NewMockServerManager(ctrl *gomock.Controller) *MockServerManager {
	mock := &MockServerManager{ctrl: ctrl}
	mock.recorder = &MockServerManagerMockRecorder{mock}
	return mock
}
972347
func (b *serverBuilder) AddDisconnectedNIC() {
	b.nicConnections = append(b.nicConnections, "")
	b.displayIPAddresses = append(b.displayIPAddresses, "")
}
607348
func (m *MockCommonAPIClient) NetworkConnect(ctx context.Context, networkID, container string, config *network.EndpointSettings) error {
	ret := m.ctrl.Call(m, "NetworkConnect", ctx, networkID, container, config)
	ret0, _ := ret[0].(error)
	return ret0
}
920933
func (s *SimpleFSHandler) SimpleFSAreWeConnectedToMDServer(
	ctx context.Context) (bool, error) {
	ctx, cancel := s.wrapContextWithTimeout(ctx)
	defer cancel()
	cli, err := s.client()
	if err != nil {
		return false, err
	}
	return cli.SimpleFSAreWeConnectedToMDServer(ctx)
}
91314
func (s *DirectoryLimits) SetConnectedDirectoriesLimitReached(v bool) *DirectoryLimits {
	s.ConnectedDirectoriesLimitReached = &v
	return s
}
1264542
func (s *server) ConnectedCount() int32 {
	replyChan := make(chan int32)

	s.query <- getConnCountMsg{reply: replyChan}

	return <-replyChan
}
215816
func (m *MockSDListener) RemoveServer(arg0 *cluster.Server) {
	m.ctrl.Call(m, "RemoveServer", arg0)
}
730614
func NewMockConnection(opts ...Opt) *MockConnection {
	copts := &Opts{}
	for _, opt := range opts {
		opt(copts)
	}

	operations := copts.Operations
	if operations == nil {
		operations = make(map[Operation]ResultDesc)
	}

	if copts.Ledger == nil {
		panic("ledger is nil")
	}

	sourceURL := copts.SourceURL
	if sourceURL == "" {
		sourceURL = "localhost:9051"
	}

	producer := servicemocks.NewMockProducer(copts.Ledger)

	c := &MockConnection{
		producer:   producer,
		producerch: producer.Register(),
		rcvch:      make(chan interface{}),
		operations: operations,
		sourceURL:  sourceURL,
	}
	return c
}
557101
func (m *MockConnectionManager) NewConnector(ctx context.Context, servers func() ([]srvcache.Server, error), name string, logger *logrus.Entry) (Connector, error) {
	ret := m.ctrl.Call(m, "NewConnector", ctx, servers, name, logger)
	ret0, _ := ret[0].(Connector)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
243049
func (c channelState) ConnectedNodes() map[NodeID]struct{} {
	nodes := make(map[NodeID]struct{})
	for _, channels := range c {
		nodes[channels.Node] = struct{}{}
	}

	// TODO(roasbeef): add outgoing, nodes, allow incoming and outgoing to
	// per node
	//  * only add node is chan as funding amt set

	return nodes
}
386895
func (nc *Conn) ConnectedUrl() string {
	if nc == nil {
		return _EMPTY_
	}

	nc.mu.RLock()
	defer nc.mu.RUnlock()

	if nc.status != CONNECTED {
		return _EMPTY_
	}
	return nc.current.url.String()
}