@@ -33,7 +33,6 @@ use webrtc::peer_connection::RTCPeerConnection;
33
33
use webrtc_data:: data_channel:: DataChannel as DetachedDataChannel ;
34
34
35
35
use std:: io;
36
- use std:: pin:: Pin ;
37
36
use std:: sync:: { Arc , Mutex as StdMutex } ;
38
37
use std:: task:: { Context , Poll } ;
39
38
@@ -226,68 +225,68 @@ impl<'a> StreamMuxer for Connection {
226
225
/// abruptly interrupt the execution.
227
226
fn destroy_outbound ( & self , _s : Self :: OutboundSubstream ) { }
228
227
229
- fn read_substream (
230
- & self ,
231
- cx : & mut Context < ' _ > ,
232
- s : & mut Self :: Substream ,
233
- buf : & mut [ u8 ] ,
234
- ) -> Poll < Result < usize , Self :: Error > > {
235
- Pin :: new ( s) . poll_read ( cx, buf)
236
- }
237
-
238
- fn write_substream (
239
- & self ,
240
- cx : & mut Context < ' _ > ,
241
- s : & mut Self :: Substream ,
242
- buf : & [ u8 ] ,
243
- ) -> Poll < Result < usize , Self :: Error > > {
244
- Pin :: new ( s) . poll_write ( cx, buf)
245
- }
246
-
247
- fn flush_substream (
248
- & self ,
249
- cx : & mut Context < ' _ > ,
250
- s : & mut Self :: Substream ,
251
- ) -> Poll < Result < ( ) , Self :: Error > > {
252
- trace ! ( "Flushing substream {}" , s. stream_identifier( ) ) ;
253
- Pin :: new ( s) . poll_flush ( cx)
254
- }
255
-
256
- fn shutdown_substream (
257
- & self ,
258
- cx : & mut Context < ' _ > ,
259
- s : & mut Self :: Substream ,
260
- ) -> Poll < Result < ( ) , Self :: Error > > {
261
- trace ! ( "Closing substream {}" , s. stream_identifier( ) ) ;
262
- Pin :: new ( s) . poll_close ( cx)
263
- }
264
-
265
- fn destroy_substream ( & self , s : Self :: Substream ) {
266
- trace ! ( "Destroying substream {}" , s. stream_identifier( ) ) ;
267
- let mut data_channels_inner = self . data_channels_inner . lock ( ) . unwrap ( ) ;
268
- data_channels_inner. map . remove ( & s. stream_identifier ( ) ) ;
269
- }
228
+ // fn read_substream(
229
+ // &self,
230
+ // cx: &mut Context<'_>,
231
+ // s: &mut Self::Substream,
232
+ // buf: &mut [u8],
233
+ // ) -> Poll<Result<usize, Self::Error>> {
234
+ // Pin::new(s).poll_read(cx, buf)
235
+ // }
236
+
237
+ // fn write_substream(
238
+ // &self,
239
+ // cx: &mut Context<'_>,
240
+ // s: &mut Self::Substream,
241
+ // buf: &[u8],
242
+ // ) -> Poll<Result<usize, Self::Error>> {
243
+ // Pin::new(s).poll_write(cx, buf)
244
+ // }
245
+
246
+ // fn flush_substream(
247
+ // &self,
248
+ // cx: &mut Context<'_>,
249
+ // s: &mut Self::Substream,
250
+ // ) -> Poll<Result<(), Self::Error>> {
251
+ // trace!("Flushing substream {}", s.stream_identifier());
252
+ // Pin::new(s).poll_flush(cx)
253
+ // }
254
+
255
+ // fn shutdown_substream(
256
+ // &self,
257
+ // cx: &mut Context<'_>,
258
+ // s: &mut Self::Substream,
259
+ // ) -> Poll<Result<(), Self::Error>> {
260
+ // trace!("Closing substream {}", s.stream_identifier());
261
+ // Pin::new(s).poll_close(cx)
262
+ // }
263
+
264
+ // fn destroy_substream(&self, s: Self::Substream) {
265
+ // trace!("Destroying substream {}", s.stream_identifier());
266
+ // let mut data_channels_inner = self.data_channels_inner.lock().unwrap();
267
+ // data_channels_inner.map.remove(&s.stream_identifier());
268
+ // }
270
269
271
270
fn poll_close ( & self , cx : & mut Context < ' _ > ) -> Poll < Result < ( ) , Self :: Error > > {
272
271
debug ! ( "Closing connection" ) ;
273
272
274
273
let mut data_channels_inner = self . data_channels_inner . lock ( ) . unwrap ( ) ;
275
274
276
275
// First, flush all the buffered data.
277
- for ( _, ch) in & mut data_channels_inner. map {
278
- match ready ! ( self . flush_substream( cx, ch) ) {
279
- Ok ( _) => continue ,
280
- Err ( e) => return Poll :: Ready ( Err ( e) ) ,
281
- }
282
- }
276
+ // for (_, ch) in &mut data_channels_inner.map {
277
+ // match ready!(self.flush_substream(cx, ch)) {
278
+ // Ok(_) => continue,
279
+ // Err(e) => return Poll::Ready(Err(e)),
280
+ // }
281
+ // }
283
282
284
283
// Second, shutdown all the substreams.
285
- for ( _, ch) in & mut data_channels_inner. map {
286
- match ready ! ( self . shutdown_substream( cx, ch) ) {
287
- Ok ( _) => continue ,
288
- Err ( e) => return Poll :: Ready ( Err ( e) ) ,
289
- }
290
- }
284
+ // for (_, ch) in &mut data_channels_inner.map {
285
+ // match ready!(self.shutdown_substream(cx, ch)) {
286
+ // Ok(_) => continue,
287
+ // Err(e) => return Poll::Ready(Err(e)),
288
+ // }
289
+ // }
291
290
292
291
// Third, close `incoming_data_channels_rx`
293
292
data_channels_inner. incoming_data_channels_rx . close ( ) ;
0 commit comments