File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 11use atomic_counter:: AtomicCounter ;
2- use std:: fs:: { create_dir_all , File } ;
2+ use std:: fs:: { File , create_dir_all } ;
33use std:: net:: { Ipv4Addr , SocketAddrV4 , TcpListener } ;
44use std:: time:: Instant ;
55use std:: { thread, time} ;
@@ -484,13 +484,15 @@ fn new_tcp_listener() -> TcpListener {
484484}
485485
486486fn listen_async ( listener : TcpListener ) {
487- thread:: spawn ( move || loop {
488- match listener. accept ( ) {
489- Ok ( _) => {
490- println ! ( "Connection received!" ) ;
491- }
492- Err ( _) => {
493- println ! ( "Error in received connection!" ) ;
487+ thread:: spawn ( move || {
488+ loop {
489+ match listener. accept ( ) {
490+ Ok ( _) => {
491+ println ! ( "Connection received!" ) ;
492+ }
493+ Err ( _) => {
494+ println ! ( "Error in received connection!" ) ;
495+ }
494496 }
495497 }
496498 } ) ;
You can’t perform that action at this time.
0 commit comments