You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: dgram.rs
    path of file: ./repos/rustix/tests/net
    
    the code of the file until where you have to start completion: //! Tests similar to connect_bind_send.rs, but operating on datagram sockets.

use rustix::net::{
    AddressFamily, Ipv6Addr, RecvFlags, SendFlags, SocketAddrAny, SocketAddrV4, SocketAddrV6,
    SocketType,
};
use std::net::{IpAddr, Ipv4Addr, SocketAddr};

/// Test `connect_any`.
#
    
fn net_dgram_v6_acceptfrom() {
    let localhost = IpAddr::V6(Ipv6Addr::LOCALHOST);
    let addr = SocketAddr::new(localhost, 0);
    let listener = rustix::net::socket(AddressFamily::INET6, SocketType::DGRAM, None).unwrap();
    rustix::net::bind(&listener, &addr).expect("bind");

    let local_addr = rustix::net::getsockname(&listener).unwrap();
    let sender = rustix::net::socket(AddressFamily::INET6, SocketType::DGRAM, None).unwrap();
    rustix::net::connect_any(&sender, &local_addr).expect("connect");
    let request = b"Hello, World!!!";
    let n = rustix::net::send(&sender, request, SendFlags::empty()).expect("send");
    drop(sender);

    // Not strictly required, but it makes the test simpler.
    assert_eq!(n, request.len());

    let mut response = [0_u8; 128];
    let n = rustix::net::recv(&listener, &mut response, RecvFlags::empty()).expect("recv");

    // Not strictly required, but it makes the test simpler.
    assert_eq!(n, request.len());

    assert_eq!(request, &response[..n]);
}