Skip to content

Commit

Permalink
Update Client.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedi6431 authored Jun 26, 2024
1 parent a224a64 commit b72662e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public Client(String address, int port) {


// get input from the terminal
input = new DataInputStream(System.in);
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

// send output to the server socket
output = new DataOutputStream(socket.getOutputStream());

Expand Down Expand Up @@ -56,7 +57,7 @@ public Client(String address, int port) {
while (!line.equalsIgnoreCase("exit")) {
// get user input
System.out.print(clientIP + " to " + serverIP + "$-");
line = input.readLine();
line = reader.readLine();
// send the received input to the server
output.writeUTF(line);
}
Expand Down

0 comments on commit b72662e

Please sign in to comment.