Tentative de récupération de fichier (problème: récupération bloquante)
This commit is contained in:
@@ -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 ?!)
|
||||
|
||||
Reference in New Issue
Block a user