Fix listing of files

This commit is contained in:
Louis Royer 2020-01-16 13:04:22 +01:00
parent c1ac428fc6
commit 019d8b321f

View File

@ -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();
}