LibSagerNetCore icon indicating copy to clipboard operation
LibSagerNetCore copied to clipboard

Tun2ray state callback

Open Nyxil opened this issue 3 years ago • 2 comments

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

Nyxil avatar Jul 19 '22 12:07 Nyxil

SN does not have this behavior.

nekohasekai avatar Jul 28 '22 06:07 nekohasekai

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

Nyxil avatar Jul 28 '22 13:07 Nyxil