mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 14:36:16 +01:00
Flush after socket write
This commit is contained in:
@@ -114,6 +114,7 @@ impl<R: ReadWrite> DebugProxyClient<R> {
|
|||||||
|
|
||||||
// Send the packet
|
// Send the packet
|
||||||
self.socket.write_all(packet.as_bytes()).await?;
|
self.socket.write_all(packet.as_bytes()).await?;
|
||||||
|
self.socket.flush().await?;
|
||||||
|
|
||||||
// Read the response
|
// Read the response
|
||||||
let response = self.read_response().await?;
|
let response = self.read_response().await?;
|
||||||
@@ -173,6 +174,7 @@ impl<R: ReadWrite> DebugProxyClient<R> {
|
|||||||
/// Returns `IdeviceError` if writing fails
|
/// Returns `IdeviceError` if writing fails
|
||||||
pub async fn send_raw(&mut self, bytes: &[u8]) -> Result<(), IdeviceError> {
|
pub async fn send_raw(&mut self, bytes: &[u8]) -> Result<(), IdeviceError> {
|
||||||
self.socket.write_all(bytes).await?;
|
self.socket.write_all(bytes).await?;
|
||||||
|
self.socket.flush().await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,6 +256,7 @@ impl<R: ReadWrite> DebugProxyClient<R> {
|
|||||||
/// Returns `IdeviceError` if writing fails
|
/// Returns `IdeviceError` if writing fails
|
||||||
pub async fn send_ack(&mut self) -> Result<(), IdeviceError> {
|
pub async fn send_ack(&mut self) -> Result<(), IdeviceError> {
|
||||||
self.socket.write_all(b"+").await?;
|
self.socket.write_all(b"+").await?;
|
||||||
|
self.socket.flush().await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,6 +266,7 @@ impl<R: ReadWrite> DebugProxyClient<R> {
|
|||||||
/// Returns `IdeviceError` if writing fails
|
/// Returns `IdeviceError` if writing fails
|
||||||
pub async fn send_noack(&mut self) -> Result<(), IdeviceError> {
|
pub async fn send_noack(&mut self) -> Result<(), IdeviceError> {
|
||||||
self.socket.write_all(b"-").await?;
|
self.socket.write_all(b"-").await?;
|
||||||
|
self.socket.flush().await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -202,6 +202,7 @@ impl<R: ReadWrite> RemoteServerClient<R> {
|
|||||||
let message = Message::new(mheader, pheader, aux, data);
|
let message = Message::new(mheader, pheader, aux, data);
|
||||||
debug!("Sending message: {message:#?}");
|
debug!("Sending message: {message:#?}");
|
||||||
self.idevice.write_all(&message.serialize()).await?;
|
self.idevice.write_all(&message.serialize()).await?;
|
||||||
|
self.idevice.flush().await?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user