Skip to content

Commit

Permalink
thread fix connecting still needs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marci1175 committed Jan 14, 2024
1 parent 3e32715 commit 68f46d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build_info.matthias_build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024.01.14. 22:22
2024.01.14. 22:25
13 changes: 2 additions & 11 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl eframe::App for backend::TemplateApp {

let sender = self.connection_sender.clone();

std::thread::spawn(move || {
tokio::spawn(async move {
match ClientConnection::connect(format!("http://{}", ip)) {
Ok(ok) => {
if let Err(err) = sender.send(ok){
Expand Down Expand Up @@ -183,15 +183,6 @@ impl eframe::App for backend::TemplateApp {
},
}

match self.client_connection.client.is_none() {
true => {

}
false => {

}
}

match self.client_connection.state {
ConnectionState::Connected => {
ui.label(RichText::from("Connected").color(Color32::GREEN));
Expand Down Expand Up @@ -293,7 +284,7 @@ impl eframe::App for backend::TemplateApp {

//Connection reciver
match self.connection_reciver.try_recv() {
Ok(connection) => self.client_connection = connection,
Ok(connection) => {self.client_connection.state = ConnectionState::Connected; self.client_connection = connection},
Err(err) => {
//dbg!(err);
},
Expand Down

0 comments on commit 68f46d7

Please sign in to comment.