File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -84,20 +84,20 @@ impl Client {
8484 self . req_tx
8585 . send ( SendingMessage :: new ( msg) )
8686 . await
87- . map_err ( |e | Error :: Others ( format ! ( "Send packet to sender error {e:?}" ) ) ) ?;
87+ . map_err ( |_ | Error :: LocalClosed ) ?;
8888
8989 let result = if timeout_nano == 0 {
9090 rx. recv ( )
9191 . await
92- . ok_or_else ( || Error :: Others ( "Receive packet from receiver error" . to_string ( ) ) ) ?
92+ . ok_or_else ( || Error :: RemoteClosed ) ?
9393 } else {
9494 tokio:: time:: timeout (
9595 std:: time:: Duration :: from_nanos ( timeout_nano as u64 ) ,
9696 rx. recv ( ) ,
9797 )
9898 . await
9999 . map_err ( |e| Error :: Others ( format ! ( "Receive packet timeout {e:?}" ) ) ) ?
100- . ok_or_else ( || Error :: Others ( "Receive packet from receiver error" . to_string ( ) ) ) ?
100+ . ok_or_else ( || Error :: RemoteClosed ) ?
101101 } ;
102102
103103 let msg = result?;
You can’t perform that action at this time.
0 commit comments