Recherche d'un bug d'interface réseaux multicast

This commit is contained in:
2022-03-08 12:01:51 +01:00
parent e9fafd3cd8
commit 30e21ce042
9 changed files with 53 additions and 25 deletions

View File

@@ -1,6 +1,9 @@
package repository
import "StoreBackEnd/pkg/protocol"
import (
"StoreBackEnd/pkg/protocol"
"bufio"
)
func CreateProtocolRepository() *ProtocolRepository {
return &ProtocolRepository{
@@ -33,14 +36,14 @@ func (repo ProtocolRepository) AddWriter(writer *protocol.IProtocolWriter) {
/*
ExecuteReader Permet d'exécuter un Reader et de récupérer la commande à renvoyer. La deuxième valeur de retour permet de savoir si une commande a put être exécuté
*/
func (repo ProtocolRepository) ExecuteReader(data string) (string, bool) {
func (repo ProtocolRepository) ExecuteReader(data string) (string, bool, func(r *bufio.Reader) (string, bool)) {
for _, reader := range repo.protocolReaders {
if (*reader).Match(data) { // Exécuter si match
// Récupérer résultat à renvoyer (Donc donner ProtocolRepository aux reader ?!)
return (*reader).Execute(data)
}
}
return "", false
return "", false, nil
}
/*