//  Connect to a new server endpoint. We can connect to at most two
//  servers. Sends [CONNECT][endpoint][service] to the agent:
501424
func (clone *Clone) Connect(address, service string) {
	clone.pipe.SendMessage("CONNECT", address, service)
}
586901
func (c *Client) Connect() (client.Session, error) {
	if c.conn == nil {
		if err := c.initConnection(); err != nil {
			return nil, err
		}
	}
	return &Session{c.conn, c.ch}, nil
}
599547
func (a *vppClient) Connect() error {
	if globalVppClient != nil {
		return fmt.Errorf("already connected to binary API, disconnect first")
	}

	rxQlen := C.int(a.inputQueueSize)
	var rc C.int
	if a.shmPrefix == "" {
		rc = C.govpp_connect(nil, rxQlen)
	} else {
		shm := C.CString(a.shmPrefix)
		rc = C.govpp_connect(shm, rxQlen)
	}
	if rc != 0 {
		return fmt.Errorf("connecting to VPP binary API failed (rc=%v)", rc)
	}

	globalVppClient = a
	return nil
}
393530
func (c *Client) Connect(conn net.Conn, addr string, options ...ConnectOption) (net.Conn, error) {
	return c.Connector.Connect(conn, addr, options...)
}
147857
func (r *BinaryInstantiateREST) Connect(ctx context.Context, name string, options runtime.Object, responder rest.Responder) (http.Handler, error) {
	return &binaryInstantiateHandler{
		r:         r,
		responder: responder,
		ctx:       ctx,
		name:      name,
		options:   options.(*buildapi.BinaryBuildRequestOptions),
	}, nil
}
623408
func (c *Conn) Connect() error {
	// Make sure the existing connection is closed
	if c.NetConn != nil {
		c.NetConn.Close()
	}

	conn, err := net.Dial("tcp", c.gateway)
	if err != nil {
		return err
	}

	tlsConn := tls.Client(conn, c.Conf)
	err = tlsConn.Handshake()
	if err != nil {
		return err
	}

	c.NetConn = tlsConn
	return nil
}
424591
func (s *service) Connect(ctx context.Context, r *taskAPI.ConnectRequest) (*taskAPI.ConnectResponse, error) {
	log.G(ctx).Debugf("Connect: %s", r.ID)

	var taskpid uint32
	p, _ := s.getProcess(r.ID, "")
	if p != nil {
		taskpid = p.stat().pid
	}

	return &taskAPI.ConnectResponse{
		ShimPid: uint32(os.Getpid()),
		TaskPid: taskpid,
		Version: runhcsShimVersion,
	}, nil
}
264151
func (_m *SchedulerQueueClient) Connect() (string, error) {
	ret := _m.Called()

	var r0 string
	if rf, ok := ret.Get(0).(func() string); ok {
		r0 = rf()
	} else {
		r0 = ret.Get(0).(string)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func() error); ok {
		r1 = rf()
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
52025
func (c *Client) Connect() error {
	c.dumpParams()
	c.terminal = false
	// wait for reset websocket signals
	go c.listenDisconnect()
	c.reset()
	return c.connect()
}
318794
func Connect(protoAddr string) (net.Conn, error) {
	proto, address := ProtocolAndAddress(protoAddr)
	conn, err := net.Dial(proto, address)
	return conn, err
}
520939
func (c *Client) Connect() error {
	rs, err := c.options("/")
	if err != nil {
		return err
	}

	err = rs.Body.Close()
	if err != nil {
		return err
	}

	if rs.StatusCode != 200 {
		return newPathError("Connect", c.root, rs.StatusCode)
	}

	return nil
}
675764
func (r *ProxyREST) Connect(ctx context.Context, id string, opts runtime.Object, responder rest.Responder) (http.Handler, error) {
	proxyOpts, ok := opts.(*api.PodProxyOptions)
	if !ok {
		return nil, fmt.Errorf("Invalid options object: %#v", opts)
	}
	location, transport, err := pod.ResourceLocation(r.Store, r.ProxyTransport, ctx, id)
	if err != nil {
		return nil, err
	}
	location.Path = net.JoinPreservingTrailingSlash(location.Path, proxyOpts.Path)
	// Return a proxy handler that uses the desired transport, wrapped with additional proxy handling (to get URL rewriting, X-Forwarded-* headers, etc)
	return newThrottledUpgradeAwareProxyHandler(location, transport, true, false, false, responder), nil
}
768330
func (c *Client) Connect(host string, port uint) (err error) {
	return c.dial(`tcp`, fmt.Sprintf(`%s:%d`, host, port))
}
1098685
func Connect(config Config) (CacheService, error) {
	mu.Lock()
	defer mu.Unlock()
	if DefaultCacheService == "" {
		if len(services) == 1 {
			for _, fn := range services {
				return fn(config)
			}
		}
		panic("there are more than one service connect func " +
			"registered but no default cache service has been specified.")
	}
	fn, ok := services[DefaultCacheService]
	if !ok {
		panic(fmt.Sprintf("service connect function for given default cache service: %s is not found.", DefaultCacheService))
	}
	return fn(config)
}
578570
func (c *agencyConnection) Endpoints() []string {
	c.mutex.RLock()
	defer c.mutex.RUnlock()

	var result []string
	for _, x := range c.connections {
		result = append(result, x.Endpoints()...)
	}
	return result
}
576833
func (r *recorder) Connect(server, model, agent string, id uint64, controllerAgent bool, userData string) {
	r.mu.Lock()
	defer r.mu.Unlock()
	if !r.enabled {
		return
	}

	pos := r.findIndex(server, id)
	if pos == -1 {
		r.entries = append(r.entries, Value{
			Model:           model,
			Server:          server,
			Agent:           agent,
			ControllerAgent: controllerAgent,
			ConnectionID:    id,
			Status:          Alive,
			UserData:        userData,
			LastSeen:        r.clock.Now(),
		})
	} else {
		// Need to access the value in the array, not a copy of it.
		r.entries[pos].Status = Alive
		r.entries[pos].LastSeen = r.clock.Now()
	}
}
1071714
func (c *UserConfig) send(request *http.Request, service *Service, client *http.Client) (*http.Response, error) {
	if err := service.Sign(request, c); err != nil {
		return nil, err
	}
	response, err := client.Do(request)
	if err != nil {
		return nil, err
	}
	if response.StatusCode != 200 {
		body, _ := ioutil.ReadAll(response.Body)
		return nil, fmt.Errorf("Endpoint response: %v %v", response.Status, string(body))
	}
	return response, nil
}