Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for errCanceled (0.17 sec)

  1. src/net/dial_unix_test.go

    	}
    
    	oe, ok := err.(*OpError)
    	if !ok || oe.Op != "dial" {
    		t.Fatalf("Dial error = %#v; want dial *OpError", err)
    	}
    
    	if oe.Err != errCanceled {
    		t.Errorf("DialContext = (%v, %v); want OpError with error %v", c, err, errCanceled)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 29 16:24:51 UTC 2022
    - 2.8K bytes
    - Viewed (0)
  2. src/net/error_test.go

    	case *fs.PathError: // for Plan 9
    		return nil
    	}
    	return fmt.Errorf("unexpected type on 1st nested level: %T", nestedErr)
    }
    
    func TestContextError(t *testing.T) {
    	if !errors.Is(errCanceled, context.Canceled) {
    		t.Error("errCanceled is not context.Canceled")
    	}
    	if !errors.Is(errTimeout, context.DeadlineExceeded) {
    		t.Error("errTimeout is not context.DeadlineExceeded")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 18 17:20:52 UTC 2023
    - 20.3K bytes
    - Viewed (0)
  3. src/net/net.go

    	errNoSuitableAddress = errors.New("no suitable address found")
    
    	// For connection setup and write operations.
    	errMissingAddress = errors.New("missing address")
    
    	// For both read and write operations.
    	errCanceled         = canceledError{}
    	ErrWriteToConnected = errors.New("use of WriteTo with pre-connected connection")
    )
    
    // canceledError lets us return the same error string we have always
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 26.8K bytes
    - Viewed (0)
  4. src/net/dial_test.go

    					}
    				}
    
    				t.Fatalf("dial error after %d ticks (%d before cancel sent): %v",
    					ticks, cancelTick-ticks, err)
    			}
    			if oe, ok := err.(*OpError); !ok || oe.Err != errCanceled {
    				t.Fatalf("dial error = %v (%T); want OpError with Err == errCanceled", err, err)
    			}
    			return // success.
    		}
    	}
    }
    
    func TestCancelAfterDial(t *testing.T) {
    	if testing.Short() {
    		t.Skip("avoiding time.Sleep")
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 20 06:04:31 UTC 2024
    - 30.3K bytes
    - Viewed (0)
  5. src/net/lookup_test.go

    		}
    		t.Logf("testHookLookupIP performing lookup")
    		return fn(ctx, network, host)
    	}
    
    	_, err := DefaultResolver.LookupIPAddr(lookupCtx, "google.com")
    	if dnsErr, ok := err.(*DNSError); !ok || dnsErr.Err != errCanceled.Error() {
    		t.Errorf("unexpected error from canceled, blocked LookupIPAddr: %v", err)
    	}
    	close(unblockLookup)
    }
    
    // Issue 24330: treat the nil *Resolver like a zero value. Verify nothing
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 41.4K bytes
    - Viewed (0)
Back to top