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