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;
|
boolean exit = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
ObjectInputStream in = new ObjectInputStream(socket.getInputStream());
|
||||||
while(!exit)
|
while(!exit)
|
||||||
{
|
{
|
||||||
ObjectInputStream in = new ObjectInputStream(socket.getInputStream());
|
|
||||||
Message message = (Message) in.readObject();
|
Message message = (Message) in.readObject();
|
||||||
if(message.getText() != null)
|
if(message.getText() != null)
|
||||||
{
|
{
|
||||||
|
@ -111,6 +111,7 @@ class ReceiveThread extends Thread {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
catch(EOFException e) {}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -373,6 +374,7 @@ public class NetworkClient {
|
||||||
|
|
||||||
user.setName(username);
|
user.setName(username);
|
||||||
known_users.add(new User(username));
|
known_users.add(new User(username));
|
||||||
|
Collections.sort(known_users);
|
||||||
|
|
||||||
chatText.append(username + " has joined the chat.\n");
|
chatText.append(username + " has joined the chat.\n");
|
||||||
chatText.setCaretPosition(chatText.getDocument().getLength());
|
chatText.setCaretPosition(chatText.getDocument().getLength());
|
||||||
|
|
Loading…
Reference in a new issue