summaryrefslogtreecommitdiffstats
path: root/examples/tinyhttp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/tinyhttp.rs')
-rw-r--r--examples/tinyhttp.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/tinyhttp.rs b/examples/tinyhttp.rs
index 2dddaf08..e0496928 100644
--- a/examples/tinyhttp.rs
+++ b/examples/tinyhttp.rs
@@ -62,9 +62,10 @@ fn main() {
}
let mut next = 0;
for socket in listener.incoming() {
- let socket = socket.expect("failed to accept");
- channels[next].unbounded_send(socket).expect("worker thread died");
- next = (next + 1) % channels.len();
+ if let Ok(socket) = socket {
+ channels[next].unbounded_send(socket).expect("worker thread died");
+ next = (next + 1) % channels.len();
+ }
}
}