repositories
/
TD_SR.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More code cleanups.
[TD_SR.git]
/
TD2
/
client
/
ThreadClientSend.java
diff --git
a/TD2/client/ThreadClientSend.java
b/TD2/client/ThreadClientSend.java
index 59ffbd0bab538c80a6b6f82f3ab094089fa7f7d1..33a8461966597c496f7d718c7bd1ae282cbbdb6c 100644
(file)
--- a/
TD2/client/ThreadClientSend.java
+++ b/
TD2/client/ThreadClientSend.java
@@
-1,4
+1,3
@@
-import java.util.concurrent.ThreadLocalRandom;
import java.io.*;
public class ThreadClientSend implements Runnable {
import java.io.*;
public class ThreadClientSend implements Runnable {
@@
-13,28
+12,28
@@
public class ThreadClientSend implements Runnable {
try {
userInput = new BufferedReader(new InputStreamReader(System.in));
boolean end = false;
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;
}
client.sendMsg(line);
System.out.println(Thread.currentThread().getName() + " a envoye " + line);
}
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) {
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);
+ }
+ }
}
}
}
}
}
}