From 1ea24a231dec8d3898a2e1a8b095b7937f60021c Mon Sep 17 00:00:00 2001 From: Emils Date: Mon, 17 Apr 2023 13:16:41 +0100 Subject: [PATCH] Allow creating UDP sockets on iOS --- crates/shadowsocks/src/net/udp.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/shadowsocks/src/net/udp.rs b/crates/shadowsocks/src/net/udp.rs index 14077c9df7f0..afce737c7da2 100644 --- a/crates/shadowsocks/src/net/udp.rs +++ b/crates/shadowsocks/src/net/udp.rs @@ -9,6 +9,7 @@ use std::{ target_os = "linux", target_os = "android", target_os = "macos", + target_os = "ios", target_os = "freebsd" ))] use std::{ @@ -20,6 +21,7 @@ use std::{ target_os = "linux", target_os = "android", target_os = "macos", + target_os = "ios", target_os = "freebsd" ))] use futures::{future, ready}; @@ -28,6 +30,7 @@ use pin_project::pin_project; target_os = "linux", target_os = "android", target_os = "macos", + target_os = "ios", target_os = "freebsd" ))] use tokio::io::Interest; @@ -46,6 +49,7 @@ use super::{ target_os = "linux", target_os = "android", target_os = "macos", + target_os = "ios", target_os = "freebsd" ))] pub struct BatchSendMessage<'a> { @@ -59,6 +63,7 @@ pub struct BatchSendMessage<'a> { target_os = "linux", target_os = "android", target_os = "macos", + target_os = "ios", target_os = "freebsd" ))] pub struct BatchRecvMessage<'a> { @@ -154,6 +159,7 @@ impl UdpSocket { target_os = "linux", target_os = "android", target_os = "macos", + target_os = "ios", target_os = "freebsd" ))] pub fn poll_batch_send( @@ -179,6 +185,7 @@ impl UdpSocket { target_os = "linux", target_os = "android", target_os = "macos", + target_os = "ios", target_os = "freebsd" ))] pub async fn batch_send(&self, msgs: &mut [BatchSendMessage<'_>]) -> io::Result { @@ -189,6 +196,7 @@ impl UdpSocket { #[cfg(any( target_os = "linux", target_os = "android", + target_os = "ios", target_os = "macos", target_os = "freebsd" ))] @@ -215,6 +223,7 @@ impl UdpSocket { target_os = "linux", target_os = "android", target_os = "macos", + target_os = "ios", target_os = "freebsd" ))] pub async fn batch_recv(&self, msgs: &mut [BatchRecvMessage<'_>]) -> io::Result {