Under Windows 7 system, if the system does not have the sp1 patch installed, specifying WSA_FLAG_NO_HANDLE_INHERIT when creating a socket will return a 10022 error. You need to change the new in socket.rs.
pub fn new(domain: Domain, ty: Type, protocol: Option) -> io::Result {
if cfg!(target_os = "windows") {
let socket = Socket::new_raw(domain, ty, protocol)?;
socket._set_no_inherit(true)?;
set_common_flags(socket)
}else{
let ty = set_common_type(ty);
Socket::new_raw(domain, ty, protocol).and_then(set_common_flags)
}
}
I'm not going to support old Windows systems with 0 updates installed. Sorry, but it's just not worth the effort. Please update to sp1, or any Windows version that is supported by Microsoft.
Under Windows 7 system, if the system does not have the sp1 patch installed, specifying WSA_FLAG_NO_HANDLE_INHERIT when creating a socket will return a 10022 error. You need to change the new in socket.rs.
pub fn new(domain: Domain, ty: Type, protocol: Option) -> io::Result {
if cfg!(target_os = "windows") {
let socket = Socket::new_raw(domain, ty, protocol)?;
socket._set_no_inherit(true)?;
set_common_flags(socket)
}else{
let ty = set_common_type(ty);
Socket::new_raw(domain, ty, protocol).and_then(set_common_flags)
}
}