Skip to content

Commit bca116c

Browse files
committed
fix(host): remove POLLERR from WSAPoll events (output-only on Windows)
Signed-off-by: danbugs <danilochiarlone@gmail.com>
1 parent 6ed274e commit bca116c

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

host/src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,17 +1862,16 @@ fn hl_sleep_poll_sockets(
18621862
) -> Result<serde_json::Value> {
18631863
use serde_json::json;
18641864
use std::os::windows::io::AsRawSocket;
1865-
use windows_sys::Win32::Networking::WinSock::{
1866-
WSAPoll, POLLERR, POLLRDNORM, POLLWRNORM, WSAPOLLFD,
1867-
};
1865+
use windows_sys::Win32::Networking::WinSock::{WSAPoll, POLLRDNORM, POLLWRNORM, WSAPOLLFD};
18681866

18691867
let tbl = table.lock().unwrap();
18701868
let mut pollfds: Vec<WSAPOLLFD> = tbl
18711869
.sockets
18721870
.values()
18731871
.map(|hs| WSAPOLLFD {
18741872
fd: hs.socket.as_raw_socket() as usize,
1875-
events: (POLLRDNORM | POLLWRNORM | POLLERR) as i16,
1873+
// POLLERR is output-only on Windows; setting it in events causes WSAEINVAL
1874+
events: (POLLRDNORM | POLLWRNORM) as i16,
18761875
revents: 0,
18771876
})
18781877
.collect();

0 commit comments

Comments
 (0)