play tricks to close fd manually

This commit is contained in:
Max Lv
2015-07-24 23:07:58 +08:00
parent 541f8de2cf
commit abb97e16c4
3 changed files with 10 additions and 0 deletions
@@ -105,6 +105,9 @@ class ShadowsocksVpnThread(vpnService: ShadowsocksVpnService) extends Thread {
val fd = getInt.invoke(fds(0)).asInstanceOf[Int]
ret = vpnService.protect(fd)
// Trick to close file decriptor
System.jniclose(fd)
if (ret) {
output.write(0)
} else {