Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 111 for pconns (0.29 sec)

  1. src/net/http/transport.go

    	pconns := t.idleConn[key]
    	var removed bool
    	switch len(pconns) {
    	case 0:
    		// Nothing
    	case 1:
    		if pconns[0] == pconn {
    			delete(t.idleConn, key)
    			removed = true
    		}
    	default:
    		for i, v := range pconns {
    			if v != pconn {
    				continue
    			}
    			// Slide down, keeping most recently-used
    			// conns at the end.
    			copy(pconns[i:], pconns[i+1:])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 21:59:21 UTC 2024
    - 91K bytes
    - Viewed (0)
  2. pilot/pkg/autoregistration/controller_test.go

    			p1conn1 = makeConn(p, time.Now())
    			c2.OnConnect(p1conn1)
    			checkEntryOrFail(t, store, wgA, p, n, c2.instanceID)
    		})
    	})
    	t.Run("slow reconnect", func(t *testing.T) {
    		// disconnect, wait and make sure entry is gone
    		c2.OnDisconnect(p1conn1)
    		retry.UntilSuccessOrFail(t, func() error {
    			return checkNoEntry(store, wgA, p)
    		})
    		// reconnect
    		p1conn1 = makeConn(p, time.Now())
    		c1.OnConnect(p1conn1)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Apr 16 00:00:36 UTC 2024
    - 31.4K bytes
    - Viewed (0)
  3. pkg/test/loadbalancersim/loadbalancer/roundrobin.go

    )
    
    func NewRoundRobin(conns []*WeightedConnection) network.Connection {
    	// Add instances for each connection based on the weight.
    	var lbConns []*WeightedConnection
    	for _, conn := range conns {
    		for i := uint32(0); i < conn.Weight; i++ {
    			lbConns = append(lbConns, conn)
    		}
    	}
    
    	// Shuffle the connections.
    	rand.Shuffle(len(lbConns), func(i, j int) {
    		lbConns[i], lbConns[j] = lbConns[j], lbConns[i]
    	})
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Feb 03 18:19:25 UTC 2022
    - 1.5K bytes
    - Viewed (0)
  4. src/cmd/go/internal/script/conds.go

    // DefaultConds returns a set of broadly useful script conditions.
    //
    // Run the 'help' command within a script engine to view a list of the available
    // conditions.
    func DefaultConds() map[string]Cond {
    	conds := make(map[string]Cond)
    
    	conds["GOOS"] = PrefixCondition(
    		"runtime.GOOS == <suffix>",
    		func(_ *State, suffix string) (bool, error) {
    			if suffix == runtime.GOOS {
    				return true, nil
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 24 21:26:10 UTC 2022
    - 5K bytes
    - Viewed (0)
  5. pkg/test/loadbalancersim/loadbalancer/weight.go

    }
    
    type weightedConnections struct {
    	conns  []*WeightedConnection
    	helper *network2.ConnectionHelper
    }
    
    func newLBConnection(name string, conns []*WeightedConnection) *weightedConnections {
    	return &weightedConnections{
    		conns:  conns,
    		helper: network2.NewConnectionHelper(name),
    	}
    }
    
    func (lb *weightedConnections) AllWeightsEqual() bool {
    	if len(lb.conns) == 0 {
    		return true
    	}
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Feb 03 18:19:25 UTC 2022
    - 2.8K bytes
    - Viewed (0)
  6. src/net/http/httptest/server.go

    	oldHook := s.Config.ConnState
    	s.Config.ConnState = func(c net.Conn, cs http.ConnState) {
    		s.mu.Lock()
    		defer s.mu.Unlock()
    
    		switch cs {
    		case http.StateNew:
    			if _, exists := s.conns[c]; exists {
    				panic("invalid state transition")
    			}
    			if s.conns == nil {
    				s.conns = make(map[net.Conn]http.ConnState)
    			}
    			// Add c to the set of tracked conns and increment it to the
    			// waitgroup.
    			s.wg.Add(1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 10 17:26:10 UTC 2024
    - 10.7K bytes
    - Viewed (0)
  7. pilot/pkg/autoregistration/connections.go

    	m.Lock()
    	defer m.Unlock()
    	var conns []connection
    	for key, connections := range m.byProxy {
    		if key.GroupName == wg.Name && key.Namespace == wg.Namespace {
    			conns = append(conns, maps.Values(connections)...)
    		}
    	}
    	return conns
    }
    
    func (m *adsConnections) Connect(conn connection) {
    	m.Lock()
    	defer m.Unlock()
    	k := makeProxyKey(conn.Proxy())
    
    	connections := m.byProxy[k]
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Sep 19 20:41:55 UTC 2023
    - 3K bytes
    - Viewed (0)
  8. src/net/http/export_test.go

    	return len(t.idleConn)
    }
    
    func (t *Transport) IdleConnStrsForTesting() []string {
    	var ret []string
    	t.idleMu.Lock()
    	defer t.idleMu.Unlock()
    	for _, conns := range t.idleConn {
    		for _, pc := range conns {
    			ret = append(ret, pc.conn.LocalAddr().String()+"/"+pc.conn.RemoteAddr().String())
    		}
    	}
    	slices.Sort(ret)
    	return ret
    }
    
    func (t *Transport) IdleConnStrsForTesting_h2() []string {
    	var ret []string
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 17 21:11:57 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  9. pkg/test/loadbalancersim/lb_test.go

    		i := i
    		client := client
    		wg.Add(1)
    		go func() {
    			// Assign weights to the endpoints.
    			var conns []*loadbalancer.WeightedConnection
    			for _, n := range s.mesh.Nodes() {
    				conns = append(conns, s.newWeightedConnection(client, n))
    			}
    
    			// Create a load balancer
    			lb := s.newLB(conns)
    
    			// Send the requests.
    			client.SendRequests(lb, s.clientRequests, func() {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu May 19 23:29:30 UTC 2022
    - 11K bytes
    - Viewed (0)
  10. src/cmd/go/internal/vcweb/svn.go

    		h.s <- &svnState{
    			listener:  l,
    			listenErr: err,
    			conns:     map[net.Conn]struct{}{},
    			done:      done,
    		}
    		if err != nil {
    			close(done)
    			return
    		}
    
    		h.logger.Printf("serving svn on svn://%v", l.Addr())
    
    		go func() {
    			for {
    				c, err := l.Accept()
    
    				s := <-h.s
    				if err != nil {
    					s.listenErr = err
    					if len(s.conns) == 0 {
    						close(s.done)
    					}
    					h.s <- s
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 25 13:44:48 UTC 2022
    - 5K bytes
    - Viewed (0)
Back to top