mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-17 05:39:53 +00:00
first step towards less cpu usage
This commit is contained in:
@@ -324,6 +324,13 @@ impl Client {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub async fn process_blocking(&mut self) -> anyhow::Result<Option<RawPacket>> {
|
||||
if let Some(packet) = self.read_packet_waiting().await? {
|
||||
return Ok(Some(packet));
|
||||
}
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub fn disconnect(&mut self) {
|
||||
self.state = ClientState::Disconnect;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user