-// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
use io::prelude::*;
use fmt;
})
}
- #[test]
- fn connect_timeout_unroutable() {
- // this IP is unroutable, so connections should always time out,
- // provided the network is reachable to begin with.
- let addr = "10.255.255.1:80".parse().unwrap();
- let e = TcpStream::connect_timeout(&addr, Duration::from_millis(250)).unwrap_err();
- assert!(e.kind() == io::ErrorKind::TimedOut ||
- e.kind() == io::ErrorKind::Other,
- "bad error: {} {:?}", e, e.kind());
- }
-
#[test]
fn connect_timeout_unbound() {
// bind and drop a socket to track down a "probably unassigned" port