Update client.rs
added tokio, to protect client connections.
This commit is contained in:
parent
2783c381e0
commit
90d8ead026
|
|
@ -133,9 +133,12 @@ impl<Out> IManager for Client<Out>
|
|||
}
|
||||
|
||||
async fn run(self: &Arc<Self>) {
|
||||
let client = self.clone();
|
||||
select! {
|
||||
val = self.connection.read::<ClientStreamIn>() => {
|
||||
self.handle_connection(val).await;
|
||||
tokio::spawn(async move {
|
||||
client.handle_connection(val).await;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue