The following code works fine virtually 100% time on all Android device Android 7.0:
DatagramSocket clientSocket = new DatagramSocket();
clientSocket.setSoTimeout(4000);
clientSocket.setReuseAddress(true);
clientSocket.setBroadcast(true);
...
DatagramPacket dpSend = new DatagramPacket(baSendData, baSendData.length, InetAddress.getByName("239.255.255.250"), 3702);
clientSocket.send(dpSend);
On Android 7.0, only on Android 7.0, clientSocket.send(dpSend) generates the following error occasionally. I want to emphasize "occasionally". It works fine most of the time.
I am wondering if anyone could offer any insight of Android 7.0 to shed some light on why the exception happens only on Android 7.0.