correction erreurs broadcast

This commit is contained in:
Auriane Lartigue 2020-12-02 09:55:58 +01:00
parent b1c4edb05e
commit e11f4cf212
3 changed files with 3 additions and 6 deletions

Binary file not shown.

View file

@ -64,9 +64,8 @@ public class ChatApp {
// Message que l'on envoie à tous les utilisateurs actifs
String broadcastMessage = "Modification Pseudo\n" + this.getMe().getPseudo() + "\n" + nouveau + "\n";
for(Integer p : ListPort ) {
if(p != this.getMe().getPort())
if(!(p.equals(this.getMe().getPort())))
{
Integer port = p ;
UDPEchange.connexion(broadcastAdress,broadcastMessage, p);
}
}
@ -84,9 +83,8 @@ public class ChatApp {
// Message que l'on envoie à tous les utilisateurs actifs
String broadcastMessage = "Connexion\n" + this.getMe().toString() ;
for(Integer p : ListPort ) {
if(p != this.getMe().getPort())
if(!(p.equals(this.getMe().getPort())))
{
Integer port = p ;
UDPEchange.connexion(broadcastAdress,broadcastMessage, p);
}
}
@ -103,9 +101,8 @@ public class ChatApp {
// Message que l'on envoie à tous les utilisateurs actifs
String broadcastMessage = "Deconnexion\n" + this.getMe().toString() ;
for(Integer p : ListPort ) {
if(p != this.getMe().getPort())
if( !(p.equals(this.getMe().getPort())))
{
Integer port = p ;
UDPEchange.connexion(broadcastAdress,broadcastMessage, p);
}
}

Binary file not shown.