Skip to content

Commit 1ea24a2

Browse files
committed
Allow creating UDP sockets on iOS
1 parent f19dc42 commit 1ea24a2

File tree

1 file changed

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

1 file changed

+9
-0
lines changed

crates/shadowsocks/src/net/udp.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use std::{
99
target_os = "linux",
1010
target_os = "android",
1111
target_os = "macos",
12+
target_os = "ios",
1213
target_os = "freebsd"
1314
))]
1415
use std::{
@@ -20,6 +21,7 @@ use std::{
2021
target_os = "linux",
2122
target_os = "android",
2223
target_os = "macos",
24+
target_os = "ios",
2325
target_os = "freebsd"
2426
))]
2527
use futures::{future, ready};
@@ -28,6 +30,7 @@ use pin_project::pin_project;
2830
target_os = "linux",
2931
target_os = "android",
3032
target_os = "macos",
33+
target_os = "ios",
3134
target_os = "freebsd"
3235
))]
3336
use tokio::io::Interest;
@@ -46,6 +49,7 @@ use super::{
4649
target_os = "linux",
4750
target_os = "android",
4851
target_os = "macos",
52+
target_os = "ios",
4953
target_os = "freebsd"
5054
))]
5155
pub struct BatchSendMessage<'a> {
@@ -59,6 +63,7 @@ pub struct BatchSendMessage<'a> {
5963
target_os = "linux",
6064
target_os = "android",
6165
target_os = "macos",
66+
target_os = "ios",
6267
target_os = "freebsd"
6368
))]
6469
pub struct BatchRecvMessage<'a> {
@@ -154,6 +159,7 @@ impl UdpSocket {
154159
target_os = "linux",
155160
target_os = "android",
156161
target_os = "macos",
162+
target_os = "ios",
157163
target_os = "freebsd"
158164
))]
159165
pub fn poll_batch_send(
@@ -179,6 +185,7 @@ impl UdpSocket {
179185
target_os = "linux",
180186
target_os = "android",
181187
target_os = "macos",
188+
target_os = "ios",
182189
target_os = "freebsd"
183190
))]
184191
pub async fn batch_send(&self, msgs: &mut [BatchSendMessage<'_>]) -> io::Result<usize> {
@@ -189,6 +196,7 @@ impl UdpSocket {
189196
#[cfg(any(
190197
target_os = "linux",
191198
target_os = "android",
199+
target_os = "ios",
192200
target_os = "macos",
193201
target_os = "freebsd"
194202
))]
@@ -215,6 +223,7 @@ impl UdpSocket {
215223
target_os = "linux",
216224
target_os = "android",
217225
target_os = "macos",
226+
target_os = "ios",
218227
target_os = "freebsd"
219228
))]
220229
pub async fn batch_recv(&self, msgs: &mut [BatchRecvMessage<'_>]) -> io::Result<usize> {

0 commit comments

Comments
 (0)