changed msg processing from string to buffer

This commit is contained in:
Mitchell 2020-07-24 12:39:30 +01:00
parent 646163b3e3
commit 28a8ec2302
1 changed files with 2 additions and 4 deletions

View File

@ -54,13 +54,11 @@ impl<'z> Server<'z> {
println!("Server: new connection, {}", addr);
let request = Commands::Request(None);
//request.to_string();
self.transmit_data(&stream, &request.to_string().as_str());
stream.read(&mut buffer).unwrap();
let incoming_message = String::from(String::from_utf8_lossy(&buffer));
let command = Commands::from(incoming_message);
let command = Commands::from(&buffer);
match command {
Commands::Connect(Some(data)) => {
let uuid = data.get("uuid").unwrap();