compio-net 0.12.0-rc.1

Networking IO for compio
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::{
    io,
    net::{SocketAddr, ToSocketAddrs},
};

use compio_runtime::ResumeUnwind;

pub async fn resolve_sock_addrs(
    host: &str,
    port: u16,
) -> io::Result<std::vec::IntoIter<SocketAddr>> {
    let host = host.to_string();
    compio_runtime::spawn_blocking(move || (host, port).to_socket_addrs())
        .await
        .resume_unwind()
        .expect("shouldn't be cancelled")
}