--- /dev/null
+import java.io.*;
+
+public class ThreadClientoSend implements Runnable {
+ private SocketClient client;
+
+ ThreadClientoSend(SocketClient c) {
+ client = c;
+ }
+
+ public void run() {
+ BufferedReader userInput = null;
+ try {
+ userInput = new BufferedReader(new InputStreamReader(System.in));
+ boolean end = false;
+ while (!end) {
+ String line = userInput.readLine();
+ if (line.equals(".")) {
+ end = true;
+ }
+ Message oMsg = new Message("Name", line);
+ client.sendoMsg(oMsg);
+ System.out.println(Thread.currentThread().getName() + " a envoye " + oMsg);
+ }
+ }
+ 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);
+ }
+ }
+ }
+ }
+}