boolean end = false;
while (!end) {
String line = userInput.readLine();
- if (line.equals(".")) {
+ if (line.equals(".")) {
end = true;
}
client.sendMsg(line);
System.out.println(Thread.currentThread().getName() + " a envoye " + line);
}
- }
+ }
catch (IOException e) {
System.err.println("IOException: " + e);
e.printStackTrace();
}
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);
+ }
+ }
}
}
}