fn send_receive_compare(
        &self,
        count: usize,
        flow_tag: FlowTag,
    ) -> Result<(), TestClientErrorCode> {
        let send_flow = FlowId::new(TransportClientType::P2P, self.next, flow_tag);
        let receive_flow = FlowId::new(TransportClientType::P2P, self.prev, flow_tag);
        let send_msg = TestClient::build_message();
        let send_copy = send_msg.clone();
        self.transport
            .send(
                self.client_type,
                &send_flow.peer_id,
                send_flow.flow_tag,
                send_msg,
            )
            .map_err(|e| {
                warn!(
                    self.log,
                    "send_receive_compare(): failed to send(): flow = {:?} err = {:?}",
                    send_flow,
                    e
                );
                TestClientErrorCode::TransportError(e)
            })?;
        info!(
            self.log,
            "send_receive_compare([{}]): sent message: flow = {:?}, msg_len = {}",
            count,
            send_flow,
            send_copy.0.len(),
        );

        let rcv_msg = match self.receive() {
            Ok(msg) => msg,
            Err(e) => return Err(e),
        };
        info!(
            self.log,
            "send_receive_compare([{}]): received response: flow = {:?}, msg_len = {}",
            count,
            rcv_msg.flow_id,
            rcv_msg.payload.0.len()
        );

        if !self.compare(receive_flow, send_copy, rcv_msg) {
            return Err(TestClientErrorCode::MessageMismatch);
        }
        Ok(())
    }
// Source mode: send the  message, receive the echoed the message, compare them
Source mode: send the  message, receive the echoed the message, compare them
Source mode : send the message receive the echoed the message compare them
fn send_receive_compare(
        &self,
        count: usize,
        flow_tag: FlowTag,
    ) -> Result<(), TestClientErrorCode> {
        let send_flow = FlowId::new(TransportClientType::P2P, self.next, flow_tag);
        let receive_flow = FlowId::new(TransportClientType::P2P, self.prev, flow_tag);
        let send_msg = TestClient::build_message();
        let send_copy = send_msg.clone();
        self.transport
            .send(
                self.client_type,
                &send_flow.peer_id,
                send_flow.flow_tag,
                send_msg,
            )
            .map_err(|e| {
                warn!(
                    self.log,
                    "send_receive_compare(): failed to send(): flow = {:?} err = {:?}",
                    send_flow,
                    e
                );
                TestClientErrorCode::TransportError(e)
            })?;
        info!(
            self.log,
            "send_receive_compare([{}]): sent message: flow = {:?}, msg_len = {}",
            count,
            send_flow,
            send_copy.0.len(),
        );
        let rcv_msg = match self.receive() {
            Ok(msg) => msg,
            Err(e) => return Err(e),
        };
        info!(
            self.log,
            "send_receive_compare([{}]): received response: flow = {:?}, msg_len = {}",
            count,
            rcv_msg.flow_id,
            rcv_msg.payload.0.len()
        );
        if !self.compare(receive_flow, send_copy, rcv_msg) {
            return Err(TestClientErrorCode::MessageMismatch);
        }
        Ok(())
    }
fn send_receive_compare ( & self , count : usize , flow_tag : FlowTag , ) -> Result < ( ) , TestClientErrorCode > { let send_flow = FlowId :: new ( TransportClientType :: P2P , self . next , flow_tag ) ; let receive_flow = FlowId :: new ( TransportClientType :: P2P , self . prev , flow_tag ) ; let send_msg = TestClient :: build_message ( ) ; let send_copy = send_msg . clone ( ) ; self . transport . send ( self . client_type , & send_flow . peer_id , send_flow . flow_tag , send_msg , ) . map_err ( | e | { warn ! ( self log " " send_flow e ) ; TestClientErrorCode :: TransportError ( e ) } ) ? ; info ! ( self log " " count send_flow send_copy 0 len ( ) ) ; let rcv_msg = match self . receive ( ) { Ok ( msg ) => msg , Err ( e ) => return Err ( e ) , } ; info ! ( self log " " count rcv_msg flow_id rcv_msg payload 0 len ( ) ) ; if ! self . compare ( receive_flow , send_copy , rcv_msg ) { return Err ( TestClientErrorCode :: MessageMismatch ) ; } Ok ( ( ) ) }
Source mode: send the  message, receive the echoed the message, compare them
Source mode : send the message receive the echoed the message compare them
&self
count
usize
flow_tag
FlowTag
&self
count
usize
flow_tag
FlowTag