diff --git a/tuic-quinn/src/lib.rs b/tuic-quinn/src/lib.rs index ea61e23..a507eaa 100644 --- a/tuic-quinn/src/lib.rs +++ b/tuic-quinn/src/lib.rs @@ -5,6 +5,7 @@ use bytes::{BufMut, Bytes}; use futures_util::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt}; use quinn::{ Connection as QuinnConnection, ConnectionError, RecvStream, SendDatagramError, SendStream, + UnknownStream, VarInt, }; use std::{ fmt::{Debug, Formatter, Result as FmtResult}, @@ -411,6 +412,15 @@ impl Connect { Side::Server(model) => model.addr(), } } + + pub fn reset( + &mut self, + error_code: VarInt, + ) -> (Result<(), UnknownStream>, Result<(), UnknownStream>) { + let send_res = self.send.reset(error_code); + let recv_res = self.recv.stop(error_code); + (send_res, recv_res) + } } impl AsyncRead for Connect {