Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleDialer (0.11 sec)

  1. src/net/example_test.go

    		// multiple connections may be served concurrently.
    		go func(c net.Conn) {
    			// Echo all incoming data.
    			io.Copy(c, c)
    			// Shut down the connection.
    			c.Close()
    		}(conn)
    	}
    }
    
    func ExampleDialer() {
    	var d net.Dialer
    	ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
    	defer cancel()
    
    	conn, err := d.DialContext(ctx, "tcp", "localhost:12345")
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 13 16:36:59 UTC 2021
    - 8.5K bytes
    - Viewed (0)
Back to top