multi-chat
This commit is contained in:
parent
90d485801d
commit
7f503531d1
3 changed files with 8 additions and 3 deletions
|
@ -479,6 +479,10 @@ public class Controller {
|
|||
/** Création de l'interface graphique **/
|
||||
ctr1.interfaceRunning =true;
|
||||
ctr1.view=Interface.createAndShowGUI(ctr1);
|
||||
ctr2.interfaceRunning =true;
|
||||
ctr2.view=Interface.createAndShowGUI(ctr2);
|
||||
ctr3.interfaceRunning =true;
|
||||
ctr3.view=Interface.createAndShowGUI(ctr3);
|
||||
|
||||
/** loop **/
|
||||
while(ctr1.interfaceRunning) {
|
||||
|
|
|
@ -91,7 +91,7 @@ public class ListeningThreadTCPChat extends ListeningThread{
|
|||
c = controller.myUser.getChats().get(indexChat);
|
||||
}
|
||||
else {
|
||||
this.controller.openSession(rm);
|
||||
c=this.controller.openSession(rm);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.net.Socket;
|
|||
public class ListeningThreadTCPConnection extends ListeningThread{
|
||||
|
||||
private Socket socket_tcp=null;
|
||||
|
||||
private int nbChat = 0;
|
||||
/* CONSTRUCTOR OF ListeningThreadTCPConnection
|
||||
* @parametres
|
||||
* @param s : String => nom du thread
|
||||
|
@ -25,7 +25,8 @@ public class ListeningThreadTCPConnection extends ListeningThread{
|
|||
|
||||
public void accept(ServerSocket servSocket) throws IOException {
|
||||
Socket socket_tcp= servSocket.accept();
|
||||
ListeningThreadTCPChat threadtcpchat = new ListeningThreadTCPChat("Chat_with_"+controller.myUser.getPseudo(),controller,socket_tcp);
|
||||
this.nbChat++;
|
||||
ListeningThreadTCPChat threadtcpchat = new ListeningThreadTCPChat("Chat_of_"+controller.myUser.getPseudo()+"_"+nbChat,controller,socket_tcp);
|
||||
threadtcpchat.start();
|
||||
threadtcpchat.interrupt();
|
||||
|
||||
|
|
Loading…
Reference in a new issue