Skip to content

Commit

Permalink
call writable
Browse files Browse the repository at this point in the history
  • Loading branch information
herr-seppia committed Oct 2, 2024
1 parent d935982 commit e4abada
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/transport/sockets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ impl MultipleOutSocket {
}
let retry_count = self.retry_count;
for i in 1..=retry_count {
self.ipv4.writable().await?;
let res = match remote_addr.is_ipv4() {
true => self.ipv4.try_send_to(data, *remote_addr),
false => self.ipv6.try_send_to(data, *remote_addr),
Expand All @@ -85,9 +86,12 @@ impl MultipleOutSocket {
}
return Ok(());
}
Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => {
Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
// Writable false positive.
continue;
if i > 1 {
info!("Message sent, recovered from previous error");
}
return Ok(());
}
Err(e) => {
if i < retry_count {
Expand Down

0 comments on commit e4abada

Please sign in to comment.