fix: async DNS resolving
This commit is contained in:
parent
d6db194a1a
commit
2a097fb800
1 changed files with 2 additions and 3 deletions
|
@ -8,7 +8,6 @@ pub use response::Response;
|
||||||
use crate::{error::*, status::*};
|
use crate::{error::*, status::*};
|
||||||
use builder::ClientBuilder;
|
use builder::ClientBuilder;
|
||||||
|
|
||||||
use std::net::ToSocketAddrs;
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use tokio::{
|
use tokio::{
|
||||||
|
@ -94,8 +93,8 @@ impl Client {
|
||||||
host: &str,
|
host: &str,
|
||||||
port: u16,
|
port: u16,
|
||||||
) -> Result<Response, LibError> {
|
) -> Result<Response, LibError> {
|
||||||
let addr = (host, port)
|
let addr = tokio::net::lookup_host((host, port))
|
||||||
.to_socket_addrs()?
|
.await?
|
||||||
.next()
|
.next()
|
||||||
.ok_or(InvalidUrl::ConvertError)?;
|
.ok_or(InvalidUrl::ConvertError)?;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue