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 26f2b8f commit b0ba1e0
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 @@ -17,7 +17,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 @@ -55,7 +56,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 b0ba1e0

Please sign in to comment.