|
@ -54,11 +54,12 @@ public class ClientHandler implements Runnable { |
|
|
if (toClientWriter != null) { |
|
|
if (toClientWriter != null) { |
|
|
toClientWriter.close(); |
|
|
toClientWriter.close(); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//Method to send a message to the client |
|
|
public void sendMessage(String message) { |
|
|
public void sendMessage(String message) { |
|
|
toClientWriter.println(message); |
|
|
|
|
|
toClientWriter.flush(); |
|
|
|
|
|
|
|
|
toClientWriter.println(message); // Send the message to the client |
|
|
|
|
|
toClientWriter.flush(); // Flush the stream |
|
|
} |
|
|
} |
|
|
} |
|
|
} |