Skip to content

Commit

Permalink
chore: Make sure to await write future for keepalive
Browse files Browse the repository at this point in the history
  • Loading branch information
qdot committed Oct 17, 2023
1 parent 1457ad3 commit 26f4064
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion buttplug/src/server/device/server_device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,10 @@ impl ServerDevice {
}
ProtocolKeepaliveStrategy::RepeatLastPacketStrategy => {
if let Some(packet) = &*keepalive_packet.read().await {
hardware.write_value(&packet);
if let Err(e) = hardware.write_value(&packet).await {
warn!("Error writing keepalive packet: {:?}", e);
break;
}
}
},
_ => {
Expand Down

0 comments on commit 26f4064

Please sign in to comment.