Hello rule patched
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"_StorBackEnd/pkg/network"
|
||||
"_StorBackEnd/pkg/protocol/managers"
|
||||
"_StorBackEnd/pkg/protocol/repository"
|
||||
"_StorBackEnd/pkg/protocol/rules/readers"
|
||||
"_StorBackEnd/pkg/protocol/rules/writers"
|
||||
)
|
||||
|
||||
@@ -17,9 +18,15 @@ func main() {
|
||||
println("StorBackEnd started !")
|
||||
|
||||
protocolRepository := repository.CreateProtocolRepository()
|
||||
helloRule := writers.CreateHelloRule("")
|
||||
|
||||
// Création des Writers
|
||||
helloRule := writers.CreateHelloRule("^(HELLO) ([A-Za-z0-9]{5,20}) ([0-9]{1,5})\r\n$")
|
||||
protocolRepository.AddWriter(&helloRule)
|
||||
|
||||
// Création des Readers
|
||||
eraseFileRule := readers.CreateEraseFileRule("^(ERASEFILE) ([A-Za-z0-9.]{50,200})\r\n$")
|
||||
protocolRepository.AddReader(&eraseFileRule)
|
||||
|
||||
multicast := network.CreateClientMulticast(MULTICAST_ADDRESS, MULTICAST_SECOND, protocolRepository)
|
||||
go multicast.Run()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user