File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
crates/data/src/data_channel Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -627,8 +627,8 @@ async fn test_poll_data_channel() -> Result<()> {
627627 let dc1 = Arc :: new ( DataChannel :: accept ( & a1, Config :: default ( ) ) . await ?) ;
628628 bridge_process_at_least_one ( & br) . await ;
629629
630- let mut poll_dc0 = PollDataChannel :: new ( dc0. clone ( ) ) ;
631- let mut poll_dc1 = PollDataChannel :: new ( dc1. clone ( ) ) ;
630+ let mut poll_dc0 = PollDataChannel :: new ( dc0) ;
631+ let mut poll_dc1 = PollDataChannel :: new ( dc1) ;
632632
633633 sbuf[ 0 ..4 ] . copy_from_slice ( & 1u32 . to_be_bytes ( ) ) ;
634634 let n = poll_dc0
@@ -650,8 +650,8 @@ async fn test_poll_data_channel() -> Result<()> {
650650 "data should match"
651651 ) ;
652652
653- dc0 . close ( ) . await ?;
654- dc1 . close ( ) . await ?;
653+ poll_dc0 . into_inner ( ) . close ( ) . await ?;
654+ poll_dc1 . into_inner ( ) . close ( ) . await ?;
655655 bridge_process_at_least_one ( & br) . await ;
656656
657657 close_association_pair ( & br, a0, a1) . await ;
Original file line number Diff line number Diff line change @@ -406,6 +406,11 @@ impl PollDataChannel {
406406 pub fn buffered_amount_low_threshold ( & self ) -> usize {
407407 self . poll_stream . buffered_amount_low_threshold ( )
408408 }
409+
410+ /// Set the capacity of the temporary read buffer (default: 8192).
411+ pub fn set_read_buf_capacity ( & mut self , capacity : usize ) {
412+ self . poll_stream . set_read_buf_capacity ( capacity)
413+ }
409414}
410415
411416impl AsyncRead for PollDataChannel {
@@ -434,6 +439,14 @@ impl AsyncWrite for PollDataChannel {
434439 fn poll_shutdown ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < io:: Result < ( ) > > {
435440 Pin :: new ( & mut self . poll_stream ) . poll_shutdown ( cx)
436441 }
442+
443+ fn poll_write_vectored (
444+ mut self : Pin < & mut Self > ,
445+ cx : & mut Context < ' _ > ,
446+ bufs : & [ io:: IoSlice < ' _ > ] ,
447+ ) -> Poll < io:: Result < usize > > {
448+ Pin :: new ( & mut self . poll_stream ) . poll_write_vectored ( cx, bufs)
449+ }
437450}
438451
439452impl Clone for PollDataChannel {
You can’t perform that action at this time.
0 commit comments