|
@ -8,16 +8,11 @@ public class ClientHandler implements Runnable { |
|
|
private BufferedReader fromClientReader; |
|
|
private BufferedReader fromClientReader; |
|
|
private PrintWriter toClientWriter; |
|
|
private PrintWriter toClientWriter; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ClientHandler(ChatServer chatServer, Socket connectionToClient) { |
|
|
public ClientHandler(ChatServer chatServer, Socket connectionToClient) { |
|
|
this.chatServer = chatServer; |
|
|
this.chatServer = chatServer; |
|
|
this.connectionToClient = connectionToClient; |
|
|
this.connectionToClient = connectionToClient; |
|
|
name = connectionToClient.getInetAddress().getHostAddress(); |
|
|
name = connectionToClient.getInetAddress().getHostAddress(); |
|
|
new Thread(this).start(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new Thread(this).start();} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void run() { |
|
|
public void run() { |
|
|