关于ios 收包问题
#473
Replies: 2 comments 2 replies
-
|
可以的,不过哪个版本的 iOS 不支持了? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
你可以这样获取FD: private var tunnelFileDescriptor: Int32? {
var buf = [CChar](repeating: 0, count: Int(IFNAMSIZ))
for fd: Int32 in 0...1024 {
var len = socklen_t(buf.count)
if getsockopt(fd, 2, 2, &buf, &len) == 0 && String(cString: buf).hasPrefix("utun") {
return fd
}
}
return nil
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
ios 已经无法通过socket.fileDescriptor 读取fd,是否可以支持packetFlow.readPackets的方式
LeafAdapater.packetTunnelProvider?.packetFlow.value(forKey: "socket.fileDescriptor") as? Int32
Beta Was this translation helpful? Give feedback.
All reactions