Skip to content

Commit

Permalink
Fix receiving from UDP sockets that aren't connected (i.e. server soc…
Browse files Browse the repository at this point in the history
…kets)
  • Loading branch information
Arshia001 authored and theduke committed Sep 6, 2023
1 parent 42596c2 commit 3f5ff85
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/wasix/src/net/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,10 @@ impl InodeSocket {
Err(err) => Err(err),
}
} else {
Err(NetworkError::NotConnected)
match socket.try_recv_from(self.data) {
Ok((amt, _)) => Ok(amt),
Err(err) => Err(err),
}
}
}
InodeSocketKind::PreSocket { .. } => {
Expand Down

0 comments on commit 3f5ff85

Please sign in to comment.