TCP fini Historique KO
This commit is contained in:
부모
9010fe3f23
커밋
2eb1862b9c
4개의 변경된 파일과 18개의 추가작업 그리고 14개의 파일을 삭제
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -36,7 +36,7 @@ public class TCPEchange {
|
|||
}catch(InterruptedException e) {
|
||||
System.out.println("Un thread s'est arrete brusquement");
|
||||
}
|
||||
System.out.println("Tout s'est passé crème");
|
||||
System.out.println("Tout s'est passe creme");
|
||||
app.getHist(User2.getPseudo()).afficher10derniers();
|
||||
|
||||
}
|
||||
|
@ -126,23 +126,27 @@ class RunnerTCPEnvoi implements Runnable {
|
|||
}
|
||||
MessageHorodate mh = new MessageHorodate(Destinataire,app.getMe(),msg,1);
|
||||
if(msg.equals("--STOP--")) {
|
||||
mh = new MessageHorodate(Destinataire,app.getMe(),msg,0);
|
||||
mh = new MessageHorodate(Destinataire,app.getMe(),msg,0); // ENVOYER JUSTE --STOP-- SUFFIT
|
||||
out.println(mh);
|
||||
out.flush();
|
||||
break;
|
||||
}
|
||||
while(!app.isHistoriqueAvailable()) {
|
||||
/* while(!app.isHistoriqueAvailable()) {
|
||||
try{wait();
|
||||
}catch(InterruptedException e) {}
|
||||
}
|
||||
app.setHistoriqueAvailable(false);
|
||||
Historique h = app.getHist(Destinataire.getPseudo());
|
||||
h.addMessage(mh);
|
||||
}*/
|
||||
//app.setHistoriqueAvailable(false);
|
||||
synchronized( this.app.getMapHistorique()) {
|
||||
Historique h = app.getHist(Destinataire.getPseudo());
|
||||
h.addMessage(mh);
|
||||
app.majHistorique(h);
|
||||
}
|
||||
|
||||
// on update la liste des historiques de app
|
||||
app.majHistorique(h);
|
||||
|
||||
//app.majHistorique2(mh.toString(),Destinataire.getPseudo());
|
||||
app.setHistoriqueAvailable(false);
|
||||
notifyAll();
|
||||
//app.setHistoriqueAvailable(false);
|
||||
//notifyAll();
|
||||
out.println(mh);
|
||||
System.out.println("Envoi d'un mesage");
|
||||
out.flush();
|
||||
|
@ -201,17 +205,17 @@ class RunnerTCPEcoute implements Runnable {
|
|||
MessageHorodate mh = MessageHorodate.stringToMessageHorodate(msg);
|
||||
System.out.println("Type du message:"+mh.getType());
|
||||
if(mh.getType()==1) {
|
||||
while(!app.isHistoriqueAvailable()) {
|
||||
/*while(!app.isHistoriqueAvailable()) {
|
||||
try{wait();
|
||||
}catch(InterruptedException e) {}
|
||||
}
|
||||
app.setHistoriqueAvailable(false);
|
||||
app.setHistoriqueAvailable(false);*/
|
||||
System.out.println("Historique mis à jour lors de la reception");
|
||||
Historique h = app.getHist(mh.getSource().getPseudo());
|
||||
h.addMessage(mh);
|
||||
app.majHistorique(h);
|
||||
app.setHistoriqueAvailable(true);
|
||||
notifyAll();
|
||||
//app.setHistoriqueAvailable(true);
|
||||
//notifyAll();
|
||||
//app.majHistorique2(mh,mh.getSource().getPseudo());
|
||||
}
|
||||
else if(mh.getType()==0) {
|
||||
|
|
불러오는 중…
Reference in a new issue