gameServer2/src/server/client.rs
changeset 12853 a9d105dc5c95
parent 12852 bd35cb2302b3
child 13119 1e39b8749072
--- 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<Action> {
+    pub fn readable(&mut self, _poll: &Poll) -> Vec<Action> {
         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<Action> {
+    pub fn error(&mut self, _poll: &Poll) -> Vec<Action> {
         return vec![ByeClient("Connection reset".to_string())]
     }
 }