Skip to content

Commit 3161a4e

Browse files
add some missing windows imports
1 parent 228cc59 commit 3161a4e

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/net/tcp/listener.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ cfg_unix! {
229229
}
230230

231231
cfg_windows! {
232-
use crate::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle};
232+
use crate::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle, AsRawSocket, RawSocket, FromRawSocket};
233233

234234
impl AsRawSocket for TcpListener {
235235
fn as_raw_socket(&self) -> RawSocket {

src/net/tcp/stream.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ cfg_unix! {
388388
}
389389

390390
cfg_windows! {
391-
use crate::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle};
391+
use crate::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle, RawSocket, AsRawSocket, FromRawSocket, IntoRawSocket};
392392

393393
impl AsRawSocket for TcpStream {
394394
fn as_raw_socket(&self) -> RawSocket {
@@ -402,9 +402,12 @@ cfg_windows! {
402402
}
403403
}
404404

405-
impl IntoRawSocket for TcpListener {
405+
impl IntoRawSocket for crate::net::tcp::TcpListener {
406406
fn into_raw_socket(self) -> RawSocket {
407-
self.raw_socket
407+
// TODO(stjepang): This does not mean `RawFd` is now the sole owner of the file
408+
// descriptor because it's possible that there are other clones of this `TcpStream`
409+
// using it at the same time. We should probably document that behavior.
410+
self.as_raw_socket()
408411
}
409412
}
410413
}

src/net/udp/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ cfg_unix! {
482482
}
483483

484484
cfg_windows! {
485-
use crate::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle};
485+
use crate::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle, RawSocket, AsRawSocket, IntoRawSocket, FromRawSocket};
486486

487487
impl AsRawSocket for UdpSocket {
488488
fn as_raw_socket(&self) -> RawSocket {

0 commit comments

Comments
 (0)