rust/hedgewars-server/src/main.rs
changeset 14824 92225a708bda
parent 14815 fc2cfec95d86
child 14851 8ddb5842fe0b
equal deleted inserted replaced
14823:a40139603cde 14824:92225a708bda
    66 
    66 
    67         for event in events.iter() {
    67         for event in events.iter() {
    68             if event.readiness() & Ready::readable() == Ready::readable() {
    68             if event.readiness() & Ready::readable() == Ready::readable() {
    69                 match event.token() {
    69                 match event.token() {
    70                     utils::SERVER_TOKEN => hw_network.accept_client(&poll).unwrap(),
    70                     utils::SERVER_TOKEN => hw_network.accept_client(&poll).unwrap(),
       
    71                     utils::TIMER_TOKEN => hw_network.handle_timeout(&poll).unwrap(),
    71                     #[cfg(feature = "official-server")]
    72                     #[cfg(feature = "official-server")]
    72                     utils::IO_TOKEN => hw_network.handle_io_result(),
    73                     utils::IO_TOKEN => hw_network.handle_io_result(),
    73                     Token(tok) => hw_network.client_readable(&poll, tok).unwrap(),
    74                     Token(tok) => hw_network.client_readable(&poll, tok).unwrap(),
    74                 }
    75                 }
    75             }
    76             }
    76             if event.readiness() & Ready::writable() == Ready::writable() {
    77             if event.readiness() & Ready::writable() == Ready::writable() {
    77                 match event.token() {
    78                 match event.token() {
    78                     utils::SERVER_TOKEN => unreachable!(),
    79                     utils::SERVER_TOKEN | utils::TIMER_TOKEN | utils::IO_TOKEN => unreachable!(),
    79                     utils::IO_TOKEN => unreachable!(),
       
    80                     Token(tok) => hw_network.client_writable(&poll, tok).unwrap(),
    80                     Token(tok) => hw_network.client_writable(&poll, tok).unwrap(),
    81                 }
    81                 }
    82             }
    82             }
    83             //            if event.kind().is_hup() || event.kind().is_error() {
    83             //            if event.kind().is_hup() || event.kind().is_error() {
    84             //                match event.token() {
    84             //                match event.token() {