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();