X-Git-Url: https://git.piment-noir.org/?p=TD_SR.git;a=blobdiff_plain;f=TD2%2Fclient%2FThreadClientoSend.java;h=dd8d03b65a1679e2745a5974164fb0248dfadc87;hp=53fdeb07addee6917201d274057b4156a39dd0ab;hb=6b300998692af2dca53cf1fe97305d27b56430b0;hpb=da31e6daf7553c6b38ca83c428dd02a3aa8af853 diff --git a/TD2/client/ThreadClientoSend.java b/TD2/client/ThreadClientoSend.java index 53fdeb0..dd8d03b 100644 --- a/TD2/client/ThreadClientoSend.java +++ b/TD2/client/ThreadClientoSend.java @@ -5,7 +5,7 @@ import java.util.Random; public class ThreadClientoSend implements Runnable { private SocketClient client; //FIXME: use a random name by thread for now - // should setable + // should be setable private String randName; ThreadClientoSend(SocketClient c) { @@ -34,9 +34,9 @@ public class ThreadClientoSend implements Runnable { try { userInput = new BufferedReader(new InputStreamReader(System.in)); boolean end = false; - while (!end) { - String line = userInput.readLine(); - if (line.equals(".")) { + while (!end) { + String line = userInput.readLine(); + if (line.equals(".")) { end = true; } Message oMsg = new Message(randName, line, Calendar.getInstance()); @@ -50,13 +50,13 @@ public class ThreadClientoSend implements Runnable { } finally { if (userInput != null) { - try { - userInput.close(); - } - catch (IOException e) { - System.err.println("IOException: " + e); - } - } + try { + userInput.close(); + } + catch (IOException e) { + System.err.println("IOException: " + e); + } + } } } }