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 **/
|
/** Création de l'interface graphique **/
|
||||||
ctr1.interfaceRunning =true;
|
ctr1.interfaceRunning =true;
|
||||||
ctr1.view=Interface.createAndShowGUI(ctr1);
|
ctr1.view=Interface.createAndShowGUI(ctr1);
|
||||||
|
ctr2.interfaceRunning =true;
|
||||||
|
ctr2.view=Interface.createAndShowGUI(ctr2);
|
||||||
|
ctr3.interfaceRunning =true;
|
||||||
|
ctr3.view=Interface.createAndShowGUI(ctr3);
|
||||||
|
|
||||||
/** loop **/
|
/** loop **/
|
||||||
while(ctr1.interfaceRunning) {
|
while(ctr1.interfaceRunning) {
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class ListeningThreadTCPChat extends ListeningThread{
|
||||||
c = controller.myUser.getChats().get(indexChat);
|
c = controller.myUser.getChats().get(indexChat);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.controller.openSession(rm);
|
c=this.controller.openSession(rm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import java.net.Socket;
|
||||||
public class ListeningThreadTCPConnection extends ListeningThread{
|
public class ListeningThreadTCPConnection extends ListeningThread{
|
||||||
|
|
||||||
private Socket socket_tcp=null;
|
private Socket socket_tcp=null;
|
||||||
|
private int nbChat = 0;
|
||||||
/* CONSTRUCTOR OF ListeningThreadTCPConnection
|
/* CONSTRUCTOR OF ListeningThreadTCPConnection
|
||||||
* @parametres
|
* @parametres
|
||||||
* @param s : String => nom du thread
|
* @param s : String => nom du thread
|
||||||
|
@ -25,7 +25,8 @@ public class ListeningThreadTCPConnection extends ListeningThread{
|
||||||
|
|
||||||
public void accept(ServerSocket servSocket) throws IOException {
|
public void accept(ServerSocket servSocket) throws IOException {
|
||||||
Socket socket_tcp= servSocket.accept();
|
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.start();
|
||||||
threadtcpchat.interrupt();
|
threadtcpchat.interrupt();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue