diff -r bd35cb2302b3 -r a9d105dc5c95 gameServer2/src/server/client.rs --- a/gameServer2/src/server/client.rs Wed Dec 06 23:46:17 2017 +0100 +++ b/gameServer2/src/server/client.rs Sat Dec 16 22:58:28 2017 +0100 @@ -42,7 +42,7 @@ } pub fn register(&mut self, poll: &Poll, token: Token) { - poll.register(&self.sock, token, Ready::all(), + poll.register(&self.sock, token, Ready::readable() | Ready::writable(), PollOpt::edge()) .ok().expect("could not register socket with event loop"); @@ -72,7 +72,7 @@ self.sock.flush(); } - pub fn readable(&mut self, poll: &Poll) -> Vec { + pub fn readable(&mut self, _poll: &Poll) -> Vec { let v = self.decoder.read_from(&mut self.sock).unwrap(); debug!("Read {} bytes", v); let mut response = Vec::new(); @@ -85,13 +85,13 @@ response } - pub fn writable(&mut self, poll: &Poll) -> io::Result<()> { + pub fn writable(&mut self, _poll: &Poll) -> io::Result<()> { self.buf_out.write_to(&mut self.sock)?; Ok(()) } - pub fn error(&mut self, poll: &Poll) -> Vec { + pub fn error(&mut self, _poll: &Poll) -> Vec { return vec![ByeClient("Connection reset".to_string())] } }