std::net::TcpStream::connect_timeout on vxworks #127018
Description
I'm tracking a issue with connect_timeout function on rust for vxworks. The function is also accepting connections on a non responsive server port. I get errors on unreachable host, but with host that are reachable any connection to a non existent server port is not resulting in an error.
example program:
use std::{
net::{SocketAddr, TcpStream},
time::Duration,
};
fn main() {
let sock_addr: SocketAddr = std::env::args()
.into_iter()
.nth(1)
.unwrap()
.parse()
.unwrap();
dbg!(sock_addr);
let timeout = Duration::from_secs(5);
let maybe_stream = TcpStream::connect_timeout(&sock_addr, timeout);
match maybe_stream {
Ok(_stream) => println!("Successfully connected to server"),
Err(err) => eprintln!("Failed to connect to server: {:?}", err),
};
}
Results:
#./exe 127.0.0.1:90 /// No server at this port
Successfully connected to server
#./exe 192.0.0.1:20 //// Host is unreachable so correct behaviour.
Failed to connect to server
#./exe 172.16.2.223:8002 //Host is reachable, but there's no server at this port
Successfully connected to server
This is not observed with the connect function.
I don't see a specified folder in library/std/src/sys/pal for vxworks. I found only one file for vxworks library/std/src/sys/pal/unix/process/process_vxworks.rs files. Does vxworks fall back on unix implementations for these functionalities? Any leads on how to proceed would be really helpful.
Activity