fn handle_writing(writing_q: &mut Queue<Event>) {
    let ready_writing_events = match writing_q.poll() {
        Ok(events) => events,
        Err(_) => {
            println!("Could not poll writing event from queue.");
            return;
        }
    };
    for mut event in ready_writing_events {
        let bytes_written = match event.stream.write(&mut event.data) {
            Err(_) => 0,
            Ok(bytes_read) => bytes_read,
        };
        if bytes_written != event.data.len() {
            println!("Not all written: buf: {}, written: {}", event.data.len(), bytes_written);
            //todo back in queue with the rest of the work
        }
    }
}
/// Handle the writing into the socket nonblocking
Handle the writing into the socket nonblocking
Handle the writing into the socket nonblocking
fn handle_writing(writing_q: &mut Queue<Event>) {
    let ready_writing_events = match writing_q.poll() {
        Ok(events) => events,
        Err(_) => {
            println!("Could not poll writing event from queue.");
            return;
        }
    };
    for mut event in ready_writing_events {
        let bytes_written = match event.stream.write(&mut event.data) {
            Err(_) => 0,
            Ok(bytes_read) => bytes_read,
        };
        if bytes_written != event.data.len() {
            println!("Not all written: buf: {}, written: {}", event.data.len(), bytes_written);
            //todo back in queue with the rest of the work
        }
    }
}
fn handle_writing ( writing_q : & mut Queue < Event > ) { let ready_writing_events = match writing_q . poll ( ) { Ok ( events ) => events , Err ( _ ) => { println ! ( " " ) ; return ; } } ; for mut event in ready_writing_events { let bytes_written = match event . stream . write ( & mut event . data ) { Err ( _ ) => 0 , Ok ( bytes_read ) => bytes_read , } ; if bytes_written != event . data . len ( ) { println ! ( " " event data len ( ) bytes_written ) ; //todo back in queue with the rest of the work } } }
Handle the writing into the socket nonblocking
Handle the writing into the socket nonblocking
writing_q
&mut Queue<Event>
writing_q
&mut Queue<Event>