Create concurrent TCP handle and implement RSD for non-lifetime structs

This commit is contained in:
Jackson Coxson
2025-08-11 10:41:55 -06:00
parent 713a2ae0c2
commit 0a0899cd8a
28 changed files with 536 additions and 149 deletions

View File

@@ -5,7 +5,6 @@ use std::os::raw::c_int;
use std::ptr::{self, null_mut};
use idevice::debug_proxy::{DebugProxyClient, DebugserverCommand};
use idevice::tcp::stream::AdapterStream;
use idevice::{IdeviceError, ReadWrite, RsdService};
use crate::core_device_proxy::AdapterHandle;
@@ -136,13 +135,14 @@ pub unsafe extern "C" fn debug_proxy_connect_rsd(
if provider.is_null() || handshake.is_null() || handshake.is_null() {
return ffi_err!(IdeviceError::FfiInvalidArg);
}
let res: Result<DebugProxyClient<AdapterStream>, IdeviceError> = RUNTIME.block_on(async move {
let provider_ref = unsafe { &mut (*provider).0 };
let handshake_ref = unsafe { &mut (*handshake).0 };
let res: Result<DebugProxyClient<Box<dyn ReadWrite>>, IdeviceError> =
RUNTIME.block_on(async move {
let provider_ref = unsafe { &mut (*provider).0 };
let handshake_ref = unsafe { &mut (*handshake).0 };
// Connect using the reference
DebugProxyClient::connect_rsd(provider_ref, handshake_ref).await
});
// Connect using the reference
DebugProxyClient::connect_rsd(provider_ref, handshake_ref).await
});
match res {
Ok(d) => {