congestion stream types

This commit is contained in:
Toshit Chawda 2024-09-07 10:41:49 -07:00
parent d6c095fe7b
commit f5b50bcc98
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
9 changed files with 103 additions and 62 deletions

View file

@ -37,6 +37,10 @@ impl ProtocolExtension for TWispServerProtocolExtension {
&[0xF0]
}
fn get_congestion_stream_types(&self) -> &'static [u8] {
&[0x03]
}
fn encode(&self) -> Bytes {
Bytes::new()
}

View file

@ -243,7 +243,10 @@ pub async fn handle_wisp(stream: WispResult, id: String) -> anyhow::Result<()> {
let mut set: JoinSet<()> = JoinSet::new();
let event: Arc<Event> = Event::new().into();
set.spawn(tokio::task::unconstrained(fut.map(|_| {})));
let mux_id = id.clone();
set.spawn(tokio::task::unconstrained(fut.map(move |x| {
trace!("wisp client id {:?} multiplexor result {:?}", mux_id, x)
})));
while let Some((connect, stream)) = mux.server_new_stream().await {
set.spawn(handle_stream(