diff options
author | dor <dor1_b@walla.com> | 2013-11-30 14:10:14 +0200 |
---|---|---|
committer | dor <dor1_b@walla.com> | 2013-11-30 14:10:14 +0200 |
commit | 666377971c25f19f4114632c1adc0ff7d5b17e99 (patch) | |
tree | e1f69568827b32a7eaac15de01cce78f124af88f /src/Client/ChatClientReader.java | |
parent | cc73f7814f82232ec09fb4849e28e8976ee6afae (diff) |
Evolving the client
Diffstat (limited to 'src/Client/ChatClientReader.java')
-rw-r--r-- | src/Client/ChatClientReader.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Client/ChatClientReader.java b/src/Client/ChatClientReader.java index b7b4ea1..64f92a0 100644 --- a/src/Client/ChatClientReader.java +++ b/src/Client/ChatClientReader.java @@ -6,9 +6,10 @@ import java.io.*; public class ChatClientReader extends Thread
{
public static Scanner reader = new Scanner(System.in);
-
private Socket soc;
+
+
public ChatClientReader (Socket soc)
{
this.soc = soc;
@@ -26,6 +27,10 @@ public class ChatClientReader extends Thread do {
line = input.readLine(); // FIXME: more then 1 line
+ if (line == null)
+ {
+ soc.close();
+ }
line = "[" + line + "]";
System.out.println("");
System.out.println(line);
@@ -36,6 +41,8 @@ public class ChatClientReader extends Thread System.err.println(e);
return;
}
+
+
}
|