Android Question Service and Sockets

canalrun

Well-Known Member
Licensed User
Longtime User
Hello,
I am developing an app using your Walkie-Talkie example as a guide.

After running the Walkie-Talkie demo, I closed it (probably using the android back button). Several days later when I ran my app I got the error message, something like, "socket in use". I had used the same port number as your demo.

My guess is that the service was still running. I uninstalled the Walkie-Talkie demo app and retried my app. It ran with no error.

The question: if I use StopService in Activity_Pause when userclosed is true, is stopping the service sufficient for closing the ServerSocket, Socket, ASyncStreams, and AudioStreamer? Or do I have to explicitly close these in the Service_Destroy event?

Thanks,
Barry.
 
Last edited:
Top