exit listener thread if BufferedReader returns null

git-svn-id: svn://anubis/gvsu@149 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
josh committed 2008-09-18 01:05:55 +00:00
1 parent 15a6beadfb
commit 7fca0357b6
1 file changed
+2
+2
View File
@@ -77,6 +77,8 @@ public class ChatClient
{ {
/* read and print a message from a peer */ /* read and print a message from a peer */
String in = br.readLine(); String in = br.readLine();
if (in == null)
break;
System.out.println(in); System.out.println(in);
} }
} }