summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2016-09-04 13:23:55 +0200
committerYorhel <git@yorhel.nl>2016-09-04 13:23:55 +0200
commit72813e1af8aaeef36a22592b83204dcbb48afdd9 (patch)
tree3c6dbf93891b4310bfdc240f0828917173d109c4 /src/main.rs
parent8578695be143045453cad83436f395cd09873435 (diff)
Add generic event loop + bind+listen handling code
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 504b7f7..9a90486 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -9,13 +9,16 @@
#[macro_use] extern crate log;
extern crate env_logger;
extern crate getopts;
+extern crate mio;
+extern crate slab;
+mod config;
+mod eventloop;
+mod listener;
use std::process::exit;
use std::io::prelude::*;
-mod config;
-
struct CliOpts {
config: String,
@@ -63,7 +66,11 @@ impl CliOpts {
fn main() {
let opts = CliOpts::new().parse();
- let conf = config::Config::parse(&opts.config);
- println!("{:?}", conf);
+ let conf = config::Config::parse(&opts.config).unwrap();
env_logger::init().unwrap();
+ trace!("Configuration read from {}: {:?}", opts.config, conf);
+
+ let mut main = eventloop::EventLoop::new();
+ listener::setup(&mut main, &conf).unwrap();
+ main.run();
}