@@ -11,7 +11,11 @@ use std::{
1111 task:: { Context , Poll , RawWaker , RawWakerVTable , Waker } ,
1212} ;
1313
14- #[ cfg( all( not( wasm_browser) , any( feature = "aws-lc-rs" , feature = "ring" ) ) ) ]
14+ #[ cfg( all(
15+ not( wasm_browser) ,
16+ any( feature = "runtime-tokio" , feature = "runtime-smol" ) ,
17+ any( feature = "aws-lc-rs" , feature = "ring" ) ,
18+ ) ) ]
1519use crate :: runtime:: default_runtime;
1620use crate :: {
1721 Instant ,
@@ -25,7 +29,11 @@ use proto::{
2529 EndpointEvent , ServerConfig ,
2630} ;
2731use rustc_hash:: FxHashMap ;
28- #[ cfg( all( not( wasm_browser) , any( feature = "aws-lc-rs" , feature = "ring" ) , ) ) ]
32+ #[ cfg( all(
33+ not( wasm_browser) ,
34+ any( feature = "runtime-tokio" , feature = "runtime-smol" ) ,
35+ any( feature = "aws-lc-rs" , feature = "ring" ) ,
36+ ) ) ]
2937use socket2:: { Domain , Protocol , Socket , Type } ;
3038use tokio:: sync:: { Notify , futures:: Notified , mpsc} ;
3139use tracing:: { Instrument , Span } ;
@@ -67,7 +75,11 @@ impl Endpoint {
6775 ///
6876 /// Some environments may not allow creation of dual-stack sockets, in which case an IPv6
6977 /// client will only be able to connect to IPv6 servers. An IPv4 client is never dual-stack.
70- #[ cfg( all( not( wasm_browser) , any( feature = "aws-lc-rs" , feature = "ring" ) ) ) ] // `EndpointConfig::default()` is only available with these
78+ #[ cfg( all(
79+ not( wasm_browser) ,
80+ any( feature = "runtime-tokio" , feature = "runtime-smol" ) ,
81+ any( feature = "aws-lc-rs" , feature = "ring" ) , // `EndpointConfig::default()` is only available with these
82+ ) ) ]
7183 pub fn client ( addr : SocketAddr ) -> io:: Result < Self > {
7284 let socket = Socket :: new ( Domain :: for_address ( addr) , Type :: DGRAM , Some ( Protocol :: UDP ) ) ?;
7385 if addr. is_ipv6 ( ) {
@@ -97,7 +109,11 @@ impl Endpoint {
97109 /// IPv6 address on Windows will not by default be able to communicate with IPv4
98110 /// addresses. Portable applications should bind an address that matches the family they wish to
99111 /// communicate within.
100- #[ cfg( all( not( wasm_browser) , any( feature = "aws-lc-rs" , feature = "ring" ) ) ) ] // `EndpointConfig::default()` is only available with these
112+ #[ cfg( all(
113+ not( wasm_browser) ,
114+ any( feature = "runtime-tokio" , feature = "runtime-smol" ) ,
115+ any( feature = "aws-lc-rs" , feature = "ring" ) , // `EndpointConfig::default()` is only available with these
116+ ) ) ]
101117 pub fn server ( config : ServerConfig , addr : SocketAddr ) -> io:: Result < Self > {
102118 let socket = std:: net:: UdpSocket :: bind ( addr) ?;
103119 let runtime =
0 commit comments