formatting

This commit is contained in:
Jonas 2022-03-27 14:22:55 +02:00
parent 4eb70bd028
commit 841a6f095c

View File

@ -7,7 +7,7 @@ import java.net.Socket;
import java.io.*; import java.io.*;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.util.Scanner; import java.util.Scanner;
import org.apache.logging.log4j.message.Message; //import org.apache.logging.log4j.message.Message;
public class Client { public class Client {
@ -23,8 +23,8 @@ public class Client {
this.out = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())); this.out = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
this.in = new BufferedReader((new InputStreamReader((socket.getInputStream())))); this.in = new BufferedReader((new InputStreamReader((socket.getInputStream()))));
//TODO add the system based generated username here. //TODO: add the system based generated username here.
//TODO hide connecting logik(next 4 lines) //TODO: hide connecting logic (next 4 lines)
this.userName = userName; this.userName = userName;
this.out.write(getUsername()); this.out.write(getUsername());
this.out.newLine(); this.out.newLine();
@ -59,7 +59,7 @@ public class Client {
*/ */
public void chatListener() { public void chatListener() {
/*TODO: what type of decoding has to be done /*TODO: what type of decoding has to be done
TODO how shall input be logged? TODO: how shall input be logged?
*/ */
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
@ -105,8 +105,8 @@ public class Client {
} }
public void closeEverything(Socket socket, BufferedReader in, BufferedWriter out) { public void closeEverything(Socket socket, BufferedReader in, BufferedWriter out) {
//TODO Correctly closing a clients connection //TODO: Correctly closing a clients connection
//TODO the server should be notified in a way so he can handle it cleanly //TODO: the server should be notified in a way so it can handle it cleanly
try { try {
if (in != null) { if (in != null) {
in.close(); in.close();