diff --git a/src/SourcePackage/SetThreadCommunication.java b/src/SourcePackage/SetThreadCommunication.java deleted file mode 100644 index d8c8577..0000000 --- a/src/SourcePackage/SetThreadCommunication.java +++ /dev/null @@ -1,13 +0,0 @@ -package SourcePackage; - -import java.net.Socket; - -public class SetThreadCommunication { - private ThreadReceiveTCPFinal threadReceiveTCP; - - public SetThreadCommunication(Socket client2Socket) { - threadReceiveTCP = new ThreadReceiveTCPFinal(client2Socket); - threadReceiveTCP.start(); - - } -} diff --git a/src/SourcePackage/ThreadAcceptTCP.java b/src/SourcePackage/ThreadAcceptTCP.java index 9cb268d..1da35e2 100644 --- a/src/SourcePackage/ThreadAcceptTCP.java +++ b/src/SourcePackage/ThreadAcceptTCP.java @@ -9,14 +9,13 @@ public class ThreadAcceptTCP extends Thread{ - private HashMap listThreadToSocket; + private ThreadReceiveTCPFinal threadReceiveTCP; private ServerSocket client1Socket ; - + public ThreadAcceptTCP(String name) { super(name); - listThreadToSocket = new HashMap<>(); try { client1Socket = new ServerSocket(Main.user.getPort()); } catch (IOException ex) { @@ -37,7 +36,9 @@ public void run() { System.out.println("port : " + client2Socket.getPort()); Main.user.putListSocket(client2Socket); // dans l'hash map des socket on va rajouter un socket du client qui se connecte - listThreadToSocket.put(client2Socket, new SetThreadCommunication(client2Socket)); //liste des threads + + threadReceiveTCP = new ThreadReceiveTCPFinal(client2Socket); + threadReceiveTCP.start(); } } } catch (IOException e) {