Skip to content

Commit

Permalink
Ignore socketpair(2) errors when sending (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
edigaryev authored Mar 25, 2024
1 parent 4a13c59 commit 8676794
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ impl Host {
interface
.set_event_callback(Events::PACKETS_AVAILABLE, move |_mask, _params| {
// Send a dummy datagram to make the other end of socketpair() readable
new_packets_tx.send(&[0; 1]).unwrap();
// and ignore the error as this merely a signalling channel to wake up
// the poller
new_packets_tx.send(&[0; 1]).ok();

// Wait for the permission to continue to avoid
// wasting CPU cycles or in case of termination,
Expand Down

0 comments on commit 8676794

Please sign in to comment.