fix failing os-test by correcting disconnect behavior

This commit is contained in:
Benton60
2026-04-06 12:50:21 -04:00
parent 6056059e49
commit 5d1981bf23
+11
View File
@@ -235,6 +235,17 @@ impl<'a> SchemeSocket for UdpSocket<'a> {
// there's no accept() for UDP
return Err(SyscallError::new(syscall::EAFNOSUPPORT));
}
"disconnect" => {
let remote_endpoint = IpListenEndpoint {
addr: None,
port: 0,
};
if let SchemeFile::Socket(ref udp_handle) = *file {
SchemeFile::Socket(udp_handle.clone_with_data(remote_endpoint))
} else {
SchemeFile::Socket(SocketFile::new_with_data(socket_handle, remote_endpoint))
}
}
_ => {
let remote_endpoint = parse_endpoint(path);
if let SchemeFile::Socket(ref udp_handle) = *file {