Commit 96c30153 authored by Gabriele Civitarese's avatar Gabriele Civitarese

modified udp

parent 5cbaaec0
......@@ -14,7 +14,7 @@ class UDPClient {
* (contattando eventualmente il DNS) */
InetAddress IPAddress = InetAddress.getByName("localhost");
byte[] sendData = new byte[1024];
byte[] sendData;
byte[] receiveData = new byte[1024];
String sentence = inFromUser.readLine();
......@@ -35,9 +35,9 @@ class UDPClient {
/* Riceve il pacchetto dal server */
clientSocket.receive(receivePacket);
String modifiedSentence = new String(receivePacket.getData());
String modifiedSentence = new String(receivePacket.getData()).trim();
System.out.println("FROM SERVER:" + modifiedSentence);
System.out.println("FROM SERVER: " + modifiedSentence);
clientSocket.close();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment