File tree 2 files changed +17
-4
lines changed
crates/data/src/data_channel
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<()> {
627
627
let dc1 = Arc :: new ( DataChannel :: accept ( & a1, Config :: default ( ) ) . await ?) ;
628
628
bridge_process_at_least_one ( & br) . await ;
629
629
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) ;
632
632
633
633
sbuf[ 0 ..4 ] . copy_from_slice ( & 1u32 . to_be_bytes ( ) ) ;
634
634
let n = poll_dc0
@@ -650,8 +650,8 @@ async fn test_poll_data_channel() -> Result<()> {
650
650
"data should match"
651
651
) ;
652
652
653
- dc0 . close ( ) . await ?;
654
- dc1 . close ( ) . await ?;
653
+ poll_dc0 . into_inner ( ) . close ( ) . await ?;
654
+ poll_dc1 . into_inner ( ) . close ( ) . await ?;
655
655
bridge_process_at_least_one ( & br) . await ;
656
656
657
657
close_association_pair ( & br, a0, a1) . await ;
Original file line number Diff line number Diff line change @@ -406,6 +406,11 @@ impl PollDataChannel {
406
406
pub fn buffered_amount_low_threshold ( & self ) -> usize {
407
407
self . poll_stream . buffered_amount_low_threshold ( )
408
408
}
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
+ }
409
414
}
410
415
411
416
impl AsyncRead for PollDataChannel {
@@ -434,6 +439,14 @@ impl AsyncWrite for PollDataChannel {
434
439
fn poll_shutdown ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < io:: Result < ( ) > > {
435
440
Pin :: new ( & mut self . poll_stream ) . poll_shutdown ( cx)
436
441
}
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
+ }
437
450
}
438
451
439
452
impl Clone for PollDataChannel {
You can’t perform that action at this time.
0 commit comments