summaryrefslogtreecommitdiff
path: root/src/listener.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/listener.rs')
-rw-r--r--src/listener.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/listener.rs b/src/listener.rs
index 2823fe0..d6dc45f 100644
--- a/src/listener.rs
+++ b/src/listener.rs
@@ -3,9 +3,9 @@ use mio::tcp::TcpListener;
use std::net::SocketAddr;
use std::io::{Result,ErrorKind};
use std::time::Duration;
-use eventloop::{Machine,Context,EventLoop,TToken};
use std::sync::{Arc,Mutex};
+use eventloop::{Machine,Context,EventLoop,TToken,Action};
use config;
use itf_http;
@@ -93,7 +93,7 @@ impl Listener {
impl Machine for Listener {
- fn handle(&mut self, ctx: &mut Context, _: Event) {
+ fn handle(&mut self, ctx: &mut Context, _: Event) -> Option<Action> {
match self.sock.accept() {
Err(err) => {
match err.kind() {
@@ -120,10 +120,12 @@ impl Machine for Listener {
}
}
}
+ None
}
- fn timeout(&mut self, ctx: &mut Context, _: TToken) {
+ fn timeout(&mut self, ctx: &mut Context, _: TToken) -> Option<Action> {
self.io = ctx.register(&self.sock, Ready::readable());
+ None
}
}