@@ -488,7 +488,7 @@ impl SmoltcpDevice {
488488 network : Network :: UDP ,
489489 } ;
490490
491- let ac = super :: udp2 :: new ( sa, sh, read_rx, self . udp_write_data_tx . clone ( ) ) ;
491+ let ac = super :: udp :: new ( sa, sh, read_rx, self . udp_write_data_tx . clone ( ) ) ;
492492
493493 //debug!("smoltcp got new udp connection {dst_ipe} {src_ipe}");
494494
@@ -510,14 +510,14 @@ impl SmoltcpDevice {
510510
511511 /// check timeout udp and remove from device's SocketSet
512512 pub fn udp_health_check ( & mut self ) {
513- debug ! ( "udp_health_check" ) ;
513+ // debug!("udp_health_check");
514514 let mut udp_src_to_remove = Vec :: new ( ) ;
515515
516516 {
517517 let m = self . udp_read_data_tx_map . lock ( ) ;
518518
519519 for ( src, sender) in m. iter ( ) {
520- debug ! ( "checking udp for {:?}" , src) ;
520+ // debug!("checking udp for {:?}", src);
521521 if sender. is_closed ( ) {
522522 //debug!("udp_health_check got a closed");
523523 udp_src_to_remove. push ( src. to_owned ( ) ) ;
@@ -545,12 +545,12 @@ impl SmoltcpDevice {
545545
546546 let so: & mut smoltcp:: socket:: tcp:: Socket = self . tcp_sockets . get_mut ( h) ;
547547
548- debug ! (
549- "checking {h}, {:?}, {:?} {}" ,
550- so. local_endpoint( ) ,
551- so. remote_endpoint( ) ,
552- so. state( )
553- ) ;
548+ // debug!(
549+ // "checking {h}, {:?}, {:?} {}",
550+ // so.local_endpoint(),
551+ // so.remote_endpoint(),
552+ // so.state()
553+ // );
554554 if !so. can_recv ( ) {
555555 debug ! ( "cant recv {h}" ) ;
556556 }
@@ -572,13 +572,13 @@ impl SmoltcpDevice {
572572 let tcp_stream_read_data_sender = m. get ( & h) . unwrap ( ) ;
573573
574574 if tcp_stream_read_data_sender. is_closed ( ) {
575- debug ! ( "{h}, will delete tcp because sender closed" ) ;
575+ // debug!("{h}, will delete tcp because sender closed");
576576 tcp_handles_to_remove. push ( h) ;
577577 tcp_src_to_remove. push ( src) ;
578578 } else {
579- if !so. can_recv ( ) {
580- debug ! ( "{h}, has src but cant recv, {}" , so. state( ) ) ;
581- }
579+ // if !so.can_recv() {
580+ // debug!("{h}, has src but cant recv, {}", so.state());
581+ // }
582582
583583 while so. can_recv ( ) && tcp_stream_read_data_sender. capacity ( ) > 0 {
584584 let mut buffer = BytesMut :: with_capacity ( so. recv_queue ( ) ) ;
@@ -602,16 +602,16 @@ impl SmoltcpDevice {
602602 break ;
603603 }
604604 } else {
605- debug ! ( "tcp_read_data_tx so.recv_slice failed" ) ;
605+ // debug!("tcp_read_data_tx so.recv_slice failed");
606606 so. close ( ) ;
607607 break ;
608608 }
609609 }
610610 if so. state ( ) == State :: CloseWait && so. send_queue ( ) == 0 {
611- debug ! (
612- "{h}, so.state() == State::CloseWait
613- && so.send_queue() == 0"
614- ) ;
611+ // debug!(
612+ // "{h}, so.state() == State::CloseWait
613+ // && so.send_queue() == 0"
614+ // );
615615 let _ =
616616 tcp_stream_read_data_sender. try_send ( BytesMut :: with_capacity ( 0 ) ) ;
617617 //这里将令 TcpStream 的 read端 收到一个 0字节,表示EOF
0 commit comments