dns-lookup 3.0.1

A simple dns resolving api, much like rust's unstable api. Also includes getaddrinfo and getnameinfo wrappers for libc variants.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::net::UdpSocket;
use std::sync::Once;

// Start windows socket library - From socket2-rs
pub(crate) fn init_winsock() {
    static INIT: Once = Once::new();

    INIT.call_once(|| {
        // Initialize winsock through the standard library by just creating a
        // dummy socket. Whether this is successful or not we drop the result as
        // libstd will be sure to have initialized winsock.
        let _ = UdpSocket::bind("127.0.0.1:34254");
    });
}