fn server(&self) {
        let mut processed = 0;
        let mut sent = 0;
        let mut qfull = 0;
        let start = Instant::now();
        let mut last_update = Instant::now();
        loop {
            let event_msg = Self::receive_message(&self.receiver);
            let request = match event_msg.message {
                TestMessage::Request(r) => r,
                _ => panic!("Unexpected message"),
            };

            let response = TestMessage::Response(Response {
                id: request.id,
                payload: vec![0u8; request.payload_size],
            });

            qfull += self.send_message(response);
            processed += 1;
            sent += request.payload_size;

            if last_update.elapsed().as_secs() > STATUS_UPDATE_SEC || (processed % 1000) == 0 {
                info!(
                    self.log,
                    "Server: processed request[{}]: sent {}, qfull = {}, {:?}, bandwidth = {}/sec",
                    processed,
                    Self::format_bytes(sent),
                    qfull,
                    start.elapsed(),
                    Self::bandwidth(sent, start.elapsed())
                );
                last_update = Instant::now();
            }
        }
    }
// The server side to process the requests
The server side to process the requests
The server side to process the requests
fn server(&self) {
        let mut processed = 0;
        let mut sent = 0;
        let mut qfull = 0;
        let start = Instant::now();
        let mut last_update = Instant::now();
        loop {
            let event_msg = Self::receive_message(&self.receiver);
            let request = match event_msg.message {
                TestMessage::Request(r) => r,
                _ => panic!("Unexpected message"),
            };
            let response = TestMessage::Response(Response {
                id: request.id,
                payload: vec![0u8; request.payload_size],
            });
            qfull += self.send_message(response);
            processed += 1;
            sent += request.payload_size;
            if last_update.elapsed().as_secs() > STATUS_UPDATE_SEC || (processed % 1000) == 0 {
                info!(
                    self.log,
                    "Server: processed request[{}]: sent {}, qfull = {}, {:?}, bandwidth = {}/sec",
                    processed,
                    Self::format_bytes(sent),
                    qfull,
                    start.elapsed(),
                    Self::bandwidth(sent, start.elapsed())
                );
                last_update = Instant::now();
            }
        }
    }
fn server ( & self ) { let mut processed = 0 ; let mut sent = 0 ; let mut qfull = 0 ; let start = Instant :: now ( ) ; let mut last_update = Instant :: now ( ) ; loop { let event_msg = Self :: receive_message ( & self . receiver ) ; let request = match event_msg . message { TestMessage :: Request ( r ) => r , _ => panic ! ( " " ) , } ; let response = TestMessage :: Response ( Response { id : request . id , payload : vec ! [ 0u8 request payload_size ] , } ) ; qfull += self . send_message ( response ) ; processed += 1 ; sent += request . payload_size ; if last_update . elapsed ( ) . as_secs ( ) > STATUS_UPDATE_SEC || ( processed % 1000 ) == 0 { info ! ( self log " " processed Self format_bytes ( sent ) qfull start elapsed ( ) Self bandwidth ( sent start elapsed ( ) ) ) ; last_update = Instant :: now ( ) ; } } }
The server side to process the requests
The server side to process the requests
&self
&self