Hi guys! I'm new with backend development and I'm ...
# server
b
Hi guys! I'm new with backend development and I'm trying to create a broadcast communication with a server and my apps when I run this server in a linux OS works but in a windows it just don't send the package, could you help me?
Copy code
try {
            clientSocket = DatagramSocket()
            val ipAdresses = InetAddress.getByName(getBroadcast())
            val sendData = ByteArray(1024)
            clientSocket?.send(DatagramPacket(sendData, sendData.size, ipAdresses, dstPort))
            clientSocket?.close()
        } catch (e: Exception) {
            if (clientSocket != null) clientSocket?.close()
        }
I've already check this ipAddresses and it's correct for linux and windows and it doesn't generate any exception =/