Added configuration
This commit is contained in:
1 parent
4b8720efdc
commit
a59e5fe39d
6 files changed
+139
-12
No files matched your search
+19
-9
@@ -1,8 +1,15 @@
|
||||
use mio::net::TcpListener;
|
||||
use mio::{Events, Interest, Poll, Token};
|
||||
use std::collections::HashMap;
|
||||
use std::io::{self};
|
||||
|
||||
use std::{
|
||||
sync::{Arc, Mutex}
|
||||
};
|
||||
|
||||
use client::{interrupted};
|
||||
use configuration::BasicConfiguration;
|
||||
use server::Server;
|
||||
|
||||
// Setup some tokens to allow us to identify which event is for which socket.
|
||||
const SERVER: Token = Token(0);
|
||||
|
||||
@@ -11,16 +18,19 @@ pub mod entity;
|
||||
pub mod protocol;
|
||||
pub mod server;
|
||||
pub mod util;
|
||||
pub mod configuration;
|
||||
|
||||
#[cfg(not(target_os = "wasi"))]
|
||||
fn main() -> io::Result<()> {
|
||||
use std::{
|
||||
rc::Rc,
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
use configuration::AdvancedConfiguration;
|
||||
|
||||
use client::{interrupted, Client};
|
||||
use server::Server;
|
||||
|
||||
|
||||
let basic_config = BasicConfiguration::load("configuration.toml");
|
||||
|
||||
|
||||
let advanced_configuration = AdvancedConfiguration::load("features.toml");
|
||||
|
||||
|
||||
simple_logger::SimpleLogger::new().init().unwrap();
|
||||
|
||||
@@ -42,8 +52,8 @@ fn main() -> io::Result<()> {
|
||||
|
||||
log::info!("You now can connect to the server");
|
||||
|
||||
let mut server = Arc::new(Mutex::new(Server::new()));
|
||||
|
||||
let server = Arc::new(Mutex::new(Server::new()));
|
||||
|
||||
loop {
|
||||
if let Err(err) = poll.poll(&mut events, None) {
|
||||
if interrupted(&err) {
|
||||
|
||||
Reference in new issue
Block a user