inbound/quic: make an option for QUIC inbound accept channel size

This commit is contained in:
eric committed 2023-09-25 17:53:09 +08:00
1 parent c54a2843eb
commit 162ccef1e4
2 files changed
+5 -2

No files matched your search

+4
View File
@@ -132,6 +132,10 @@ lazy_static! {
get_env_var_or("UDP_DOWNLINK_CHANNEL_SIZE", 256)
};
pub static ref QUIC_ACCEPT_CHANNEL_SIZE: usize = {
get_env_var_or("QUIC_ACCEPT_CHANNEL_SIZE", 1024)
};
/// Buffer size for UDP datagrams receiving/sending, in KB.
pub static ref DATAGRAM_BUFFER_SIZE: usize = {
get_env_var_or("DATAGRAM_BUFFER_SIZE", 2)
+1 -2
View File
@@ -135,8 +135,7 @@ async fn handle_conn(
#[async_trait]
impl InboundDatagramHandler for Handler {
async fn handle<'a>(&'a self, socket: AnyInboundDatagram) -> io::Result<AnyInboundTransport> {
// FIXME What is a good size for this?
let (stream_tx, stream_rx) = channel(1024);
let (stream_tx, stream_rx) = channel(*crate::option::QUIC_ACCEPT_CHANNEL_SIZE);
let endpoint = quinn::Endpoint::new(
quinn::EndpointConfig::default(),
Some(self.server_config.clone()),