I have a VPNService in Android which calls:
mInterface = builder.setSession("VPNtoSocket")
.setMtu(20000)
.addAddress("10.8.0.2", 32)
.addDnsServer("8.8.8.8")
.addRoute("0.0.0.0", 0)
.establish();
everything works well the first time. Then, I stop the VPNService and I make sure that the following code is called:
mInterface.close();
If I start the VPNService a second time from the same application instance, I get a crash during the establish call with the following error:
"Cannot set address"
I have doubled checked everything and the VPNService is stopped properly and all VPN-related threads in my code are stopped.
Any idea what I'm doing wrong? Is it possible to start/stop/start a VPNService with the same address?