Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tun2ray state callback #9

Open
Nyxil opened this issue Jul 19, 2022 · 2 comments
Open

Tun2ray state callback #9

Nyxil opened this issue Jul 19, 2022 · 2 comments

Comments

@Nyxil
Copy link

Nyxil commented Jul 19, 2022

Calling Libcore.newTun2ray(config) will cause the tun to get killed after a delay and not getting initialized as expected.
A Thread.sleep(2000) after calling newTun2ray will make it initialized and everything getting work very well.
I have created a new project and implemented everything from scratch, so i'm pretty sure the newTun2ray will get killed without a sleep after it (you can try it yourself)
I have also read the sagernet android app's source code and there are loops (sleeps) after this method which make it work (not getting killed).
I think should be a callback from the newTun2ray to be able to wait from kotlin side for tun to get initialized

@nekohasekai
Copy link
Member

SN does not have this behavior.

@Nyxil
Copy link
Author

Nyxil commented Jul 28, 2022

yes, you're right, i will investigate more why my implementation dies
you can close the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants