Skip to content

Commit af3925d

Browse files
committed
feat: impls AsSocket, AsRawSocket for UdpSocket
1 parent 393e09c commit af3925d

File tree

1 file changed

+14
-0
lines changed
  • crates/shadowsocks/src/net

1 file changed

+14
-0
lines changed

crates/shadowsocks/src/net/udp.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,3 +414,17 @@ impl std::os::fd::AsFd for UdpSocket {
414414
self.socket.as_fd()
415415
}
416416
}
417+
418+
#[cfg(windows)]
419+
impl std::os::windows::io::AsRawSocket for UdpSocket {
420+
fn as_raw_socket(&self) -> std::os::windows::io::RawSocket {
421+
self.socket.as_raw_socket()
422+
}
423+
}
424+
425+
#[cfg(windows)]
426+
impl std::os::windows::io::AsSocket for UdpSocket {
427+
fn as_socket(&self) -> std::os::windows::io::BorrowedSocket<'_> {
428+
self.socket.as_socket();
429+
}
430+
}

0 commit comments

Comments
 (0)