Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 260 for dialIP (0.26 sec)

  1. src/net/dial_test.go

    	defer ln.Close()
    	_, port, err := SplitHostPort(ln.Addr().String())
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	ctx := contextWithNonZeroDeadline{Context: context.Background()}
    	var dialer Dialer
    	c, err := dialer.DialContext(ctx, "tcp", JoinHostPort("", port))
    	if err != nil {
    		t.Fatal(err)
    	}
    	c.Close()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 20 06:04:31 UTC 2024
    - 30.3K bytes
    - Viewed (0)
  2. src/net/net_fake_test.go

    		if err != nil {
    			t.Fatalf("unexpected error from Dial with %v connections: %v", len(dialed), err)
    		}
    		dialed = append(dialed, c)
    		if testing.Verbose() && len(dialed)%(1<<12) == 0 {
    			t.Logf("dialed %d connections", len(dialed))
    		}
    	}
    	t.Logf("dialed %d connections", len(dialed))
    
    	// Now that all of the ports are in use, dialing another should fail due
    	// to port exhaustion, which (for POSIX-like socket APIs) should return
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 18 17:20:52 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  3. src/net/tcpsock_unix_test.go

    			cancel()
    		}()
    		go func(i int) {
    			defer wg.Done()
    			var dialer Dialer
    			// Try to connect to a real host on a port
    			// that it is not listening on.
    			_, err := dialer.DialContext(ctx, "tcp", "golang.org:3")
    			if err == nil {
    				t.Errorf("Dial to unbound port succeeded on attempt %d", i)
    			}
    			<-sem
    		}(i)
    	}
    	wg.Wait()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 18 17:20:52 UTC 2023
    - 2.3K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/server/egressselector/egress_selector_test.go

    		},
    	}
    
    	for _, tc := range testcases {
    		t.Run(tc.name, func(t *testing.T) {
    			// Setup the various pieces such as the fake dialer prior to initializing the egress selector.
    			// Go doesn't allow function pointer comparison, nor does its reflect package
    			// So overriding the default dialer to detect if it is returned.
    			fake := &fakeEgressSelection{}
    			directDialer = fake.fakeDirectDialer
    			cs, err := NewEgressSelector(tc.input)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jan 26 22:41:29 UTC 2023
    - 12.3K bytes
    - Viewed (0)
  5. src/net/tcpsock_test.go

    		}()
    	}
    	attempts := 10 * N
    	fails := 0
    	d := &Dialer{Timeout: 200 * time.Millisecond}
    	for i := 0; i < attempts; i++ {
    		c, err := d.Dial("tcp", ln.Addr().String())
    		if err != nil {
    			fails++
    		} else {
    			c.Close()
    		}
    	}
    	ln.Close()
    	wg.Wait()
    	if fails > attempts/9 { // see issues 7400 and 7541
    		t.Fatalf("too many Dial failed: %v", fails)
    	}
    	if fails > 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 20 06:04:31 UTC 2024
    - 17.7K bytes
    - Viewed (0)
  6. src/net/http/transport_dial_test.go

    }
    
    // wantDial waits for the Transport to start a Dial.
    func (dt *transportDialTester) wantDial() *transportDialTesterConn {
    	c := <-dt.dials
    	c.connID = dt.dialCount
    	dt.dialCount++
    	dt.t.Logf("Dial %v: started", c.connID)
    	return c
    }
    
    // finish completes a Dial.
    func (c *transportDialTesterConn) finish(err error) {
    	c.t.Logf("Dial %v: finished (err:%v)", c.connID, err)
    	c.ready <- err
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 17 21:11:57 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  7. src/net/tcpsock_posix.go

    	ctrlCtxFn := sd.Dialer.ControlContext
    	if ctrlCtxFn == nil && sd.Dialer.Control != nil {
    		ctrlCtxFn = func(ctx context.Context, network, address string, c syscall.RawConn) error {
    			return sd.Dialer.Control(network, address, c)
    		}
    	}
    	fd, err := internetSocket(ctx, sd.network, laddr, raddr, syscall.SOCK_STREAM, proto, "dial", ctrlCtxFn)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:54:32 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  8. src/net/tcpconn_keepalive_test.go

    	defer ls.teardown()
    	if err := ls.buildup(handler); err != nil {
    		t.Fatal(err)
    	}
    
    	for _, cfg := range testConfigs {
    		d := Dialer{
    			KeepAlive:       defaultTCPKeepAliveIdle, // should be ignored
    			KeepAliveConfig: cfg}
    		c, err := d.Dial("tcp", ls.Listener.Addr().String())
    		if err != nil {
    			t.Fatal(err)
    		}
    		defer c.Close()
    
    		if errHook != nil {
    			t.Fatal(errHook)
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 03:10:07 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  9. src/net/http/socks_bundle.go

    		a.IP = net.ParseIP(host)
    		if a.IP == nil {
    			a.Name = host
    		}
    		if i == 0 {
    			proxy = a
    		} else {
    			dst = a
    		}
    	}
    	return
    }
    
    // NewDialer returns a new Dialer that dials through the provided
    // proxy server's network and address.
    func socksNewDialer(network, address string) *socksDialer {
    	return &socksDialer{proxyNetwork: network, proxyAddress: address, cmd: socksCmdConnect}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 11 22:42:18 UTC 2023
    - 12.9K bytes
    - Viewed (0)
  10. internal/http/dial_others.go

    // DialContext is a function to make custom Dial for internode communications
    type DialContext func(ctx context.Context, network, address string) (net.Conn, error)
    
    // NewInternodeDialContext configures a custom dialer for internode communications
    func NewInternodeDialContext(dialTimeout time.Duration, _ TCPOptions) DialContext {
    	return func(ctx context.Context, network, addr string) (net.Conn, error) {
    		dialer := &net.Dialer{
    			Timeout: dialTimeout,
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed Apr 24 04:08:47 UTC 2024
    - 1.6K bytes
    - Viewed (0)
Back to top