Merge branch 'basic-server-framework' of https://github.com/Mitch161/rust-chat-server into basic-server-framework

This commit is contained in:
Mitchell 2020-06-04 13:50:05 +00:00
commit 317427b836
1 changed files with 21 additions and 0 deletions

View File

@ -8,6 +8,27 @@ enum Message {
Terminate,
}
pub mod protocol_messages {
pub const REQUEST: &'static str = "?request:";
pub const INFO: &'static str = "?info!";
// results
pub const SUCCESS: &'static str = "!success:";
pub const ERROR: &'static str = "!error:";
// connect commands
pub const CONNECT: &'static str = "!connect:";
pub const DISCONNECT: &'static str = "!disconnect:";
// server commands
pub const UPDATE_CLIENTS: &'static str = "!clientUpdate:";
pub const CLIENT: &'static str = "!client:";
pub const TEST: &'static str = "!test:";
// ptp commands
pub const MESSAGE: &'static str = "!message:";
}
pub struct ThreadPool{
workers: Vec<Worker>,
sender: mpsc::Sender<Message>,