TD2: Be more informative at exception catching.
[TD_SR.git] / TD2 / client / ThreadClientReceive.java
1 import java.io.*;
2
3 public class ThreadClientReceive implements Runnable {
4 private SocketClient client;
5
6 ThreadClientReceive(SocketClient c) {
7 client = c;
8 }
9
10 public void run() {
11 try {
12 boolean end = false;
13 //FIXME: not exiting properly randomly from that loop!
14 while (!end) {
15 String rline = client.receiveMsg();
16 if (rline.equals(".")) {
17 end = true;
18 }
19 System.out.println(Thread.currentThread().getName() + " a recu " + rline);
20 }
21 }
22 catch (IOException e) {
23 System.err.println("IOException: " + e);
24 e.printStackTrace();
25 }
26 }
27 }