Commit 06b1e54c authored by Benjamin Lee's avatar Benjamin Lee 💬
Browse files

Disconnect clients on any send error.

parent 73710aac
......@@ -314,10 +314,13 @@ impl Server {
Err(err) => {
if err.kind() != io::ErrorKind::WouldBlock {
error!("error sending packet to {} ({})", addr, err);
// TODO possibly disconnect these clients
self.send_queue.pop_front();
let (addr, _) = self.send_queue.pop_front().unwrap();
// Disconnect any client that errors.
self.remove_client(&addr)?;
}
else {
break;
}
break;
},
// Pretty sure this never happens?
Ok(bytes_written) => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment