Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for IdleConnCountForTesting (0.23 sec)

  1. src/net/http/export_test.go

    		for _, cc := range ccs {
    			if cc.idleState().canTakeNewRequest {
    				ret = append(ret, k)
    			}
    		}
    	}
    
    	slices.Sort(ret)
    	return ret
    }
    
    func (t *Transport) IdleConnCountForTesting(scheme, addr string) int {
    	t.idleMu.Lock()
    	defer t.idleMu.Unlock()
    	key := connectMethodKey{"", scheme, addr, false}
    	cacheKey := key.String()
    	for k, conns := range t.idleConn {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 17 21:11:57 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  2. src/net/http/transport_test.go

    	if keys[0] != cacheKey {
    		t.Fatalf("Expected idle cache key %q; got %q", cacheKey, keys[0])
    	}
    	if e, g := 1, tr.IdleConnCountForTesting("http", addr); e != g {
    		t.Errorf("after first response, expected %d idle conns; got %d", e, g)
    	}
    
    	resch <- "res2"
    	<-donech
    	if g, w := tr.IdleConnCountForTesting("http", addr), 2; g != w {
    		t.Errorf("after second response, idle conns = %d; want %d", g, w)
    	}
    
    	resch <- "res3"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 21:59:21 UTC 2024
    - 192.6K bytes
    - Viewed (0)
Back to top