blob: 92a35d06e281625904a5a6f8cc5eaefb91812fa0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#[macro_use]
extern crate log;
use mio::net::TcpListener;
use std::thread;
use whirl::server;
fn main() {
dotenv::dotenv().ok(); // Adds ability to use environment variables
pretty_env_logger::init(); // Adds pretty logging
let mut threads = vec![];
threads.push(thread::spawn(move || {
debug!("spawned AutoServer thread");
server::auto::server::AutoServer::new(
TcpListener::bind(
&"0.0.0.0:6650".parse().unwrap()
).unwrap()
);
}));
threads.push(thread::spawn(move || {
debug!("spawned RoomServer thread");
server::room::server::RoomServer::new(
TcpListener::bind(
&"0.0.0.0:5673".parse().unwrap()
).unwrap()
);
}));
for thread in threads {
let _ = thread.join(); // Handle Result by dissolving it.
}
}
|