equal
deleted
inserted
replaced
29 poll.register(&self.listener, utils::SERVER, Ready::readable(), |
29 poll.register(&self.listener, utils::SERVER, Ready::readable(), |
30 PollOpt::edge()) |
30 PollOpt::edge()) |
31 } |
31 } |
32 |
32 |
33 pub fn accept(&mut self, poll: &Poll) -> io::Result<()> { |
33 pub fn accept(&mut self, poll: &Poll) -> io::Result<()> { |
34 let (sock, addr) = self.listener.accept().unwrap(); |
34 let (sock, addr) = self.listener.accept()?; |
35 println!("Connected: {}", addr); |
35 println!("Connected: {}", addr); |
36 |
36 |
37 let client = HWClient::new(sock); |
37 let client = HWClient::new(sock); |
38 let token = self.clients.insert(client) |
38 let token = self.clients.insert(client) |
39 .ok().expect("could not add connection to slab"); |
39 .ok().expect("could not add connection to slab"); |