trying to fix udp telegram

This commit is contained in:
2026-03-26 19:55:07 +07:00
parent 64d09ee7bf
commit 3eb2df3a34
10 changed files with 65 additions and 59 deletions
+4 -3
View File
@@ -41,7 +41,8 @@ impl StreamHandler {
let target_str = String::from_utf8_lossy(&payload).to_string();
let muxer = self.muxer.clone();
let (v_tx, v_rx) = tokio::sync::mpsc::channel(NetworkConfig::global().stream_capacity);
let (v_tx, v_rx) =
tokio::sync::mpsc::channel(NetworkConfig::global().tcp_stream_capacity);
muxer.register_stream(stream_id, v_tx);
tokio::spawn(async move {
@@ -83,7 +84,8 @@ impl StreamHandler {
let target_str = String::from_utf8_lossy(&payload).to_string();
let muxer = self.muxer.clone();
let (v_tx, v_rx) = tokio::sync::mpsc::channel(NetworkConfig::global().stream_capacity);
let (v_tx, v_rx) =
tokio::sync::mpsc::channel(NetworkConfig::global().udp_stream_capacity);
muxer.register_stream(stream_id, v_tx);
tokio::spawn(async move {
@@ -128,7 +130,6 @@ impl StreamHandler {
}
async fn on_close(&self, stream_id: u32) {
self.muxer.dispatch_to_local(stream_id, Bytes::new()).await;
self.muxer.remove_stream(stream_id);
}
}