mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-22 11:13:44 +00:00
quinn: add proper guards to Endpoint constructor helpers
This commit is contained in:
committed by
Benjamin Saunders
parent
74c035822b
commit
272dd5d45f
+1
-1
@@ -9,7 +9,7 @@ publish = false
|
||||
anyhow = "1.0.22"
|
||||
bytes = "1"
|
||||
hdrhistogram = { version = "7.2", default-features = false }
|
||||
quinn = { path = "../quinn" }
|
||||
quinn = { path = "../quinn", features = ["ring"] }
|
||||
rcgen = "0.13"
|
||||
rustls = { version = "0.23", default-features = false, features = ["ring", "std"] }
|
||||
clap = { version = "4", features = ["derive"] }
|
||||
|
||||
@@ -12,8 +12,10 @@ use std::{
|
||||
time::Instant,
|
||||
};
|
||||
|
||||
#[cfg(feature = "ring")]
|
||||
use crate::runtime::default_runtime;
|
||||
use crate::{
|
||||
runtime::{default_runtime, AsyncUdpSocket, Runtime},
|
||||
runtime::{AsyncUdpSocket, Runtime},
|
||||
udp_transmit,
|
||||
};
|
||||
use bytes::{Bytes, BytesMut};
|
||||
@@ -56,6 +58,7 @@ impl Endpoint {
|
||||
/// IPv6 address on Windows will not by default be able to communicate with IPv4
|
||||
/// addresses. Portable applications should bind an address that matches the family they wish to
|
||||
/// communicate within.
|
||||
#[cfg(feature = "ring")]
|
||||
pub fn client(addr: SocketAddr) -> io::Result<Self> {
|
||||
let socket = std::net::UdpSocket::bind(addr)?;
|
||||
let runtime = default_runtime()
|
||||
@@ -74,6 +77,7 @@ impl Endpoint {
|
||||
/// IPv6 address on Windows will not by default be able to communicate with IPv4
|
||||
/// addresses. Portable applications should bind an address that matches the family they wish to
|
||||
/// communicate within.
|
||||
#[cfg(feature = "ring")]
|
||||
pub fn server(config: ServerConfig, addr: SocketAddr) -> io::Result<Self> {
|
||||
let socket = std::net::UdpSocket::bind(addr)?;
|
||||
let runtime = default_runtime()
|
||||
|
||||
Reference in New Issue
Block a user