try {
userInput = new BufferedReader(new InputStreamReader(System.in));
boolean end = false;
- while (!end) {
- String line = userInput.readLine();
+ while (!end) {
+ String line = userInput.readLine();
if (line.equals(".")) {
end = true;
}
- client.sendMsg(line);
- System.out.println(Thread.currentThread().getName() + " a envoye " + line);
+ if (line.length() != 0) {
+ client.sendMsg(line);
+ System.out.println(Thread.currentThread().getName() + " a envoye " + line);
+ }
}
}
catch (IOException e) {
}
catch (IOException e) {
System.err.println("IOException: " + e);
+ e.printStackTrace();
}
}
}