Commit 9a841e90 authored by Max Lv's avatar Max Lv

refine the exception handling

parent de7e5162
......@@ -123,6 +123,14 @@ class ShadowsocksVpnThread(vpnService: ShadowsocksVpnService) extends Thread {
} catch {
case e: IOException => {
Log.e(TAG, "Error when accept socket", e)
if (ShadowsocksVpn.serverSocket != null) {
try {
ShadowsocksVpn.serverSocket.close()
} catch {
case _: Exception => // ignore
}
ShadowsocksVpn.serverSocket = null
}
return
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment