bugfixes TCP (final)
This commit is contained in:
parent
899be6991c
commit
018624b364
1 changed files with 4 additions and 2 deletions
|
@ -72,9 +72,9 @@ class ReceiveThread extends Thread {
|
|||
boolean exit = false;
|
||||
try
|
||||
{
|
||||
ObjectInputStream in = new ObjectInputStream(socket.getInputStream());
|
||||
while(!exit)
|
||||
{
|
||||
ObjectInputStream in = new ObjectInputStream(socket.getInputStream());
|
||||
{
|
||||
Message message = (Message) in.readObject();
|
||||
if(message.getText() != null)
|
||||
{
|
||||
|
@ -111,6 +111,7 @@ class ReceiveThread extends Thread {
|
|||
|
||||
|
||||
}
|
||||
catch(EOFException e) {}
|
||||
catch(Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
|
@ -373,6 +374,7 @@ public class NetworkClient {
|
|||
|
||||
user.setName(username);
|
||||
known_users.add(new User(username));
|
||||
Collections.sort(known_users);
|
||||
|
||||
chatText.append(username + " has joined the chat.\n");
|
||||
chatText.setCaretPosition(chatText.getDocument().getLength());
|
||||
|
|
Loading…
Reference in a new issue