diff --git a/udp/UDPServer.java b/udp/UDPServer.java index 1d4dd5eb1d2dd507af0961b882894ed719b32ddc..29f1a30f576a8ca159a6d959fba10ae8df906c91 100644 --- a/udp/UDPServer.java +++ b/udp/UDPServer.java @@ -7,12 +7,15 @@ class UDPServer { DatagramSocket serverSocket = new DatagramSocket(9876); - byte[] receiveData = new byte[1024]; - byte[] sendData = new byte[1024]; + byte[] receiveData; + byte[] sendData; while(true) { + receiveData = new byte[1024]; + sendData = new byte[1024]; + /* Prepara la struttura dati usata per contenere il pacchetto in ricezione */ DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length);