Skip to content

Commit

Permalink
fixed some problems in chat client.
Browse files Browse the repository at this point in the history
  • Loading branch information
JuKu committed Oct 26, 2016
1 parent dd5ded1 commit 867fce9
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected void initSocket (NetSocket socket) {
String str = buffer.toString(StandardCharsets.UTF_8);
JSONObject json = new JSONObject(str);

System.out.println("message received: " + str);
//System.out.println("message received: " + str);

//convert to chat message
ChatMessage msg = ChatMessage.create(json);
Expand Down Expand Up @@ -148,14 +148,8 @@ public void sendMessageToServer(String text) {
throw new IllegalStateException("Client isnt connected yet.");
}

//create new chat message
ChatMessage msg = ChatMessage.create(text);

String str = msg.toJSON().toString();
System.out.println("sendMessageToServer: " + str);

//send text
this.socket.write(str);
this.socket.write(text);
}

@Override
Expand Down

0 comments on commit 867fce9

Please sign in to comment.