how to set_only_v6
#3175
-
Assume the following two scenarios
How to listen on :::80 via tokio? async fn main() {
// let v6 = TcpListener::bind(":::80", set_v6_only=true).await.unwrap();
loop {
v6.accept().await.unwrap();
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
taiki-e
Nov 24, 2020
Replies: 2 comments 1 reply
-
IIRC, neither |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
FH0
-
What happens if you go through |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
IIRC, neither
tokio::net::TcpListener
norstd::net::TcpListener
supports this. You probably need to usesocket2
crate to createstd::net::TcpListener
and convert it totokio::net::TcpListener
withfrom_std
function.