Skip to content

Commit

Permalink
Use write_all in IPC transport (#648)
Browse files Browse the repository at this point in the history
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
  • Loading branch information
Bobface and tomusdrw authored Mar 27, 2023
1 parent eadfdd8 commit 68f2a6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transports/ipc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ async fn run_server(unix_stream: UnixStream, messages_rx: UnboundedReceiverStrea
}

let bytes = helpers::to_string(&rpc::Request::Single(rpc_call)).into_bytes();
if let Err(err) = socket_writer.write(&bytes).await {
if let Err(err) = socket_writer.write_all(&bytes).await {
pending_response_txs.remove(&request_id);
log::error!("IPC write error: {:?}", err);
}
Expand All @@ -213,7 +213,7 @@ async fn run_server(unix_stream: UnixStream, messages_rx: UnboundedReceiverStrea

let bytes = helpers::to_string(&rpc::Request::Batch(rpc_calls)).into_bytes();

if let Err(err) = socket_writer.write(&bytes).await {
if let Err(err) = socket_writer.write_all(&bytes).await {
log::error!("IPC write error: {:?}", err);
for request_id in request_ids {
pending_response_txs.remove(&request_id);
Expand Down

0 comments on commit 68f2a6d

Please sign in to comment.