File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -51,15 +51,20 @@ pub async fn serve(
5151
5252 // Accept incoming connections
5353 loop {
54- if let Ok ( ( socket, addr) ) = listener. accept ( ) . await {
55- let factory_ref = factory. clone ( ) ;
56- println ! ( "Accepted connection from {}" , addr) ;
54+ match listener. accept ( ) . await {
55+ Ok ( ( socket, addr) ) => {
56+ let factory_ref = factory. clone ( ) ;
57+ println ! ( "Accepted connection from {}" , addr) ;
5758
58- tokio:: spawn ( async move {
59- if let Err ( e) = process_socket ( socket, None , factory_ref) . await {
60- eprintln ! ( "Error processing socket: {}" , e) ;
61- }
62- } ) ;
63- } ;
59+ tokio:: spawn ( async move {
60+ if let Err ( e) = process_socket ( socket, None , factory_ref) . await {
61+ eprintln ! ( "Error processing socket: {}" , e) ;
62+ }
63+ } ) ;
64+ }
65+ Err ( e) => {
66+ eprintln ! ( "Error accept socket: {}" , e) ;
67+ }
68+ }
6469 }
6570}
You can’t perform that action at this time.
0 commit comments