fn handle_reading(reading_q: &mut Queue<Event>, writing_q: &mut Queue<Event>) {
    let ready_reading_events = match reading_q.poll() {
        Ok(events) => events,
        Err(_) => {
            println!("Could not poll reading event from queue.");
            return;
        }
    };
    for mut reading_event in ready_reading_events {
        if let Err(_) = reading_event.stream.read(&mut reading_event.data) {
            let response = Response::default_bad_request().make_sendable();
            let event = Event::new_write(reading_event.stream, from_slice(&response[..]));
            let worked = writing_q.add(event);
            if let Err(_) = worked {
                println!("Error while sending response.")
            }
            return;
        };
        let response = create_response(reading_event.data, reading_q.dir.clone());
        let event = Event::new_write(reading_event.stream, from_slice(&response[..]));
        let worked = writing_q.add(event);
        if let Err(_) = worked {
            println!("Error while sending response")
        }
    }
}
/// Handle the reading from the socket nonblocking
Handle the reading from the socket nonblocking
Handle the reading from the socket nonblocking
fn handle_reading(reading_q: &mut Queue<Event>, writing_q: &mut Queue<Event>) {
    let ready_reading_events = match reading_q.poll() {
        Ok(events) => events,
        Err(_) => {
            println!("Could not poll reading event from queue.");
            return;
        }
    };
    for mut reading_event in ready_reading_events {
        if let Err(_) = reading_event.stream.read(&mut reading_event.data) {
            let response = Response::default_bad_request().make_sendable();
            let event = Event::new_write(reading_event.stream, from_slice(&response[..]));
            let worked = writing_q.add(event);
            if let Err(_) = worked {
                println!("Error while sending response.")
            }
            return;
        };
        let response = create_response(reading_event.data, reading_q.dir.clone());
        let event = Event::new_write(reading_event.stream, from_slice(&response[..]));
        let worked = writing_q.add(event);
        if let Err(_) = worked {
            println!("Error while sending response")
        }
    }
}
fn handle_reading ( reading_q : & mut Queue < Event > , writing_q : & mut Queue < Event > ) { let ready_reading_events = match reading_q . poll ( ) { Ok ( events ) => events , Err ( _ ) => { println ! ( " " ) ; return ; } } ; for mut reading_event in ready_reading_events { if let Err ( _ ) = reading_event . stream . read ( & mut reading_event . data ) { let response = Response :: default_bad_request ( ) . make_sendable ( ) ; let event = Event :: new_write ( reading_event . stream , from_slice ( & response [ .. ] ) ) ; let worked = writing_q . add ( event ) ; if let Err ( _ ) = worked { println ! ( " " ) } return ; } ; let response = create_response ( reading_event . data , reading_q . dir . clone ( ) ) ; let event = Event :: new_write ( reading_event . stream , from_slice ( & response [ .. ] ) ) ; let worked = writing_q . add ( event ) ; if let Err ( _ ) = worked { println ! ( " " ) } } }
Handle the reading from the socket nonblocking
Handle the reading from the socket nonblocking
reading_q
&mut Queue<Event>
writing_q
&mut Queue<Event>
reading_q
&mut Queue<Event>
writing_q
&mut Queue<Event>