File tree Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ autocfg = "1"
36
36
libc = " 0.2.77"
37
37
38
38
[target .'cfg(windows)' .dependencies ]
39
- winapi = { version = " 0.3.9 " , features = [" winsock2 " ] }
39
+ windows-sys = { version = " 0.42 " , features = [" Win32_Networking_WinSock " ] }
40
40
41
41
[dev-dependencies ]
42
42
async-channel = " 1"
Original file line number Diff line number Diff line change @@ -681,17 +681,10 @@ impl<T: AsRawSocket> Async<T> {
681
681
682
682
// Put the socket in non-blocking mode.
683
683
684
- use winapi:: ctypes;
685
- use winapi:: um:: winsock2;
686
-
687
- let mut nonblocking = true as ctypes:: c_ulong ;
688
- let res = unsafe {
689
- winsock2:: ioctlsocket (
690
- sock as winsock2:: SOCKET ,
691
- winsock2:: FIONBIO ,
692
- & mut nonblocking,
693
- )
694
- } ;
684
+ use windows_sys:: Win32 :: Networking :: WinSock ;
685
+
686
+ let mut nonblocking = true as _ ;
687
+ let res = unsafe { WinSock :: ioctlsocket ( sock as _ , WinSock :: FIONBIO , & mut nonblocking) } ;
695
688
if res != 0 {
696
689
return Err ( io:: Error :: last_os_error ( ) ) ;
697
690
}
You can’t perform that action at this time.
0 commit comments