Skip to content

Commit

Permalink
fix(sockets): 🐛 Ignore error 997 (overlapped IO) (#2522)
Browse files Browse the repository at this point in the history
  • Loading branch information
zmerp authored Nov 19, 2024
1 parent 944c950 commit ec82fc3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion alvr/common/src/connection_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ pub trait HandleTryAgain<T> {
impl<T> HandleTryAgain<T> for io::Result<T> {
fn handle_try_again(self) -> ConResult<T> {
self.map_err(|e| {
if e.kind() == io::ErrorKind::TimedOut || e.kind() == io::ErrorKind::WouldBlock {
// Ignore ERROR_IO_PENDING on Windows (code 997)
if e.kind() == io::ErrorKind::TimedOut
|| e.kind() == io::ErrorKind::WouldBlock
|| (cfg!(windows) && e.raw_os_error() == Some(997))
{
ConnectionError::TryAgain(e.into())
} else {
ConnectionError::Other(e.into())
Expand Down

0 comments on commit ec82fc3

Please sign in to comment.