Browse Source

Move handler to proto module.

wip
Titouan Rigoudy 9 years ago
parent
commit
16f10d1083
3 changed files with 6 additions and 4 deletions
  1. +1
    -2
      src/main.rs
  2. +2
    -2
      src/proto/handler.rs
  3. +3
    -0
      src/proto/mod.rs

+ 1
- 2
src/main.rs View File

@ -3,7 +3,6 @@
mod client; mod client;
mod config; mod config;
mod control; mod control;
mod handler;
mod proto; mod proto;
mod room; mod room;
mod user; mod user;
@ -24,7 +23,7 @@ use std::thread;
use mio::EventLoop; use mio::EventLoop;
use client::Client; use client::Client;
use handler::ConnectionHandler;
use proto::ConnectionHandler;
fn main() { fn main() {
match env_logger::init() { match env_logger::init() {


src/handler.rs → src/proto/handler.rs View File

@ -6,8 +6,8 @@ use std::sync::mpsc::Sender;
use mio::{EventLoop, EventSet, Handler, PollOpt, Token}; use mio::{EventLoop, EventSet, Handler, PollOpt, Token};
use mio::tcp::TcpStream; use mio::tcp::TcpStream;
use proto::{Packet, PacketStream, Request, Response};
use proto::server::*;
use super::{Packet, PacketStream, Request, Response};
use super::server::*;
struct TokenCounter { struct TokenCounter {
counter: usize, counter: usize,

+ 3
- 0
src/proto/mod.rs View File

@ -1,6 +1,9 @@
mod handler;
mod packet; mod packet;
pub mod server; pub mod server;
pub use self::handler::ConnectionHandler;
pub use self::packet::{ pub use self::packet::{
Packet, Packet,
PacketReadError, PacketReadError,


Loading…
Cancel
Save