TcpStream::connect returns success when connecting to an nonexistent server.
I've tested running the Rust example code for TcpStream::connect in Redox. When trying to connect to a nonexistent server:
use std::net::TcpStream;
if let Ok(stream) = TcpStream::connect("123.4.5.6:789") {
println!("Connected to the server!");
} else {
println!("Couldn't connect to server...");
}
Prints Connected to the server!
Toolchain: rustc 1.32.0-nightly (15d77040 2018-11-06)
Commit hash: 212002419aba0ae5780c867a58f8796306804427
Qemu verison: QEMU emulator version 2.8.1(Debian 1:2.8+dfsg-6+deb9u5)