From 019d8b321f9040782a01473b418170aca7111401 Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 16 Jan 2020 13:04:22 +0100 Subject: [PATCH] Fix listing of files --- src/clientP2P/ClientManagementUDP.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/clientP2P/ClientManagementUDP.java b/src/clientP2P/ClientManagementUDP.java index 8561a74..36cb5e5 100644 --- a/src/clientP2P/ClientManagementUDP.java +++ b/src/clientP2P/ClientManagementUDP.java @@ -139,13 +139,15 @@ public class ClientManagementUDP implements Runnable { try{ InetAddress dst = InetAddress.getByName(host); byte [] buffer = msg.getBytes(); + byte [] buffer2 = new byte[1500]; DatagramSocket socket = new DatagramSocket(); - DatagramPacket reception = new DatagramPacket(buffer, buffer.length); + DatagramPacket reception = new DatagramPacket(buffer2, 1500); DatagramPacket emission = new DatagramPacket(buffer, buffer.length, dst, UDPPort); socket.send(emission); socket.receive(reception); return new String(reception.getData(), 0, reception.getLength()); } catch (Exception e){ + System.out.println(e); throw new TransmissionError(); }