Consider
async fn test_unspecified_remote_addr(family: IpAddressFamily) {
let sock = UdpSocket::create(family).unwrap();
let unspec = IpSocketAddress::unspecified(family, PORT);
let result = sock.send(vec![0; 1], Some(unspec)).await;
assert!(matches!(result, Err(ErrorCode::InvalidArgument)));
}
The test above fails.
According to the spec:
invalid-argument: The IP address in remote-address is set to INADDR_ANY (0.0.0.0 / ::).
The current implementation returns remote-unreachable instead. The behavior is consistent on macOS, Windows and Linux.
Consider
The test above fails.
According to the spec:
invalid-argument: The IP address inremote-addressis set to INADDR_ANY (0.0.0.0/::).The current implementation returns
remote-unreachableinstead. The behavior is consistent on macOS, Windows and Linux.