From 5cbaaec0a7ab489e378ade223a7f496ba730aaa8 Mon Sep 17 00:00:00 2001 From: Gabriele Civitarese Date: Wed, 20 Mar 2019 10:51:55 +0100 Subject: [PATCH] pulizia strutture dati --- udp/UDPServer.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/udp/UDPServer.java b/udp/UDPServer.java index 1d4dd5e..29f1a30 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); -- 2.18.1