added check for success return message
This commit is contained in:
parent
b62d32dcd5
commit
1ebde0f0ed
|
|
@ -77,11 +77,7 @@ impl<'a> Client<'a> {
|
|||
match command {
|
||||
|
||||
Commands::Info(Some(params)) => {
|
||||
self.get_stream().write_all(a.to_string().as_bytes());
|
||||
/* why not do this?
|
||||
*
|
||||
* self.transmit_data(a.to_string().as_str());
|
||||
*/
|
||||
self.transmit_data(a.to_string().as_str());
|
||||
},
|
||||
Commands::Disconnect(None) => {
|
||||
|
||||
|
|
@ -89,10 +85,17 @@ impl<'a> Client<'a> {
|
|||
Commands::ClientRemove(Some(params)) => {},
|
||||
Commands::Client(Some(params)) => {
|
||||
self.transmit_data(a.to_string().as_str());
|
||||
todo!()
|
||||
/*
|
||||
* a success message needs to be read and confirmed
|
||||
*/
|
||||
|
||||
let command = Commands::from(&buffer);
|
||||
match command{
|
||||
Commands::Success(None) => {
|
||||
println!("sucess confirmed");
|
||||
},
|
||||
_ => {
|
||||
let error = Commands::Error(None);
|
||||
self.transmit_data(error.to_string().as_str());
|
||||
},
|
||||
}
|
||||
},
|
||||
Commands::Success(data) => {},
|
||||
_ => {},
|
||||
|
|
|
|||
Loading…
Reference in New Issue