diff --git a/pkg/network/ServerUnicast.go b/pkg/network/ServerUnicast.go index 3e4c655..f39f53c 100644 --- a/pkg/network/ServerUnicast.go +++ b/pkg/network/ServerUnicast.go @@ -1,14 +1,16 @@ package network import ( + "_StorBackEnd/pkg/protocol" "bufio" "fmt" "net" ) type ServerUnicast struct { - Network string - Address string + Network string + Address string + ReqManager protocol.RequestManager } func (server ServerUnicast) Run() { @@ -27,13 +29,12 @@ func (server ServerUnicast) Run() { fmt.Printf("Error while accepting client : %s\n", err) return } else { - line, err := bufio.NewReader(con).ReadString('\n') if err != nil { return } - fmt.Printf("MESSAGE : %s\n", line) + server.ReqManager.Execute(line) } } diff --git a/pkg/protocol/RequestManager.go b/pkg/protocol/RequestManager.go new file mode 100644 index 0000000..47c2ef8 --- /dev/null +++ b/pkg/protocol/RequestManager.go @@ -0,0 +1,10 @@ +package protocol + +type RequestManager struct { +} + +func (receiver RequestManager) Execute(request string) { + // On lis ce que l'on reçoit + + // On renvoie la réponse (Comment pour fichier ?) +}