From 02495f1d444ee6d034156147c3fcd0ad1e1924e4 Mon Sep 17 00:00:00 2001 From: alterdekim Date: Sat, 5 Oct 2024 03:25:38 +0300 Subject: [PATCH] modified: src/mobile.rs --- src/mobile.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mobile.rs b/src/mobile.rs index c1cc466..6df054b 100644 --- a/src/mobile.rs +++ b/src/mobile.rs @@ -4,11 +4,11 @@ use crate::config::{ ServerConfiguration, ClientConfiguration, ObfsProtocol, Ser use fast32::base32::RFC4648; use crate::client; use jni::sys::jint; +use tokio::runtime::Runtime; pub fn mobile_run(cfg_raw: String, close_fd_on_drop: bool, tun_fd: jint) -> c_int { let config: ClientConfiguration = serde_yaml::from_slice(RFC4648.decode(cfg_raw.as_bytes()).unwrap().as_slice()).expect("Bad client config file structure"); - - client::client_mode(config, tun_fd).await + Runtime::new().unwrap().block_on(client::client_mode(config, tun_fd)) /*let block = async move { let mut config = tun2::Configuration::default();