Tentative de récupération de fichier (problème: récupération bloquante)

This commit is contained in:
2022-03-08 17:44:10 +01:00
parent b030af03c9
commit 38a177aa51
7 changed files with 34 additions and 32 deletions

View File

@@ -2,7 +2,7 @@ package repository
import (
"StoreBackEnd/pkg/protocol"
"bufio"
"net"
)
func CreateProtocolRepository() *ProtocolRepository {
@@ -36,7 +36,7 @@ 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(r *bufio.Reader) (string, bool)) {
func (repo ProtocolRepository) ExecuteReader(data string) (string, bool, func(r net.Conn) (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 ?!)