Skip to content

Commit

Permalink
protocol : use send_timeout in fallback_function (#3980)
Browse files Browse the repository at this point in the history
  • Loading branch information
modship authored May 25, 2023
1 parent 765fe8b commit a138b93
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions massa-protocol-worker/src/handlers/peer_handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,9 @@ impl InitConnectionHandler<PeerId, Context, MessagesHandler> for MassaHandshake
warn!("Failed to serialize message: {}", err);
return;
}
//TODO: Make it non blockable
if let Err(err) = endpoint.send::<PeerId>(buf.as_slice()) {
if let Err(err) =
endpoint.send_timeout::<PeerId>(buf.as_slice(), Duration::from_millis(200))
{
warn!("Failed to send message: {}", err);
return;
}
Expand Down

0 comments on commit a138b93

Please sign in to comment.