Envoie de l'annonce en multicast fonctionnelle

This commit is contained in:
2022-02-22 09:35:44 +01:00
parent e9e1dbf6d8
commit 9eb4e8204e
7 changed files with 36 additions and 14 deletions

View File

@@ -2,8 +2,9 @@ package main
import (
"_StorBackEnd/pkg/network"
"_StorBackEnd/pkg/protocol"
"_StorBackEnd/pkg/protocol/managers"
"_StorBackEnd/pkg/protocol/repository"
"_StorBackEnd/pkg/protocol/rules/writers"
)
const (
@@ -14,12 +15,15 @@ const (
func main() {
println("StorBackEnd started !")
protocolRepository := repository.CreateProtocolRepository()
helloRule := writers.CreateHelloRule("")
protocolRepository.AddWriter(&helloRule)
multicast := network.CreateClientMulticast(MULTICAST_ADDRESS, MULTICAST_SECOND, protocolRepository)
go multicast.Run()
requestManager := protocol.RequestManager{Repository: protocolRepository}
requestManager := managers.RequestManager{Repository: protocolRepository}
server := network.ServerUnicast{Network: "tcp", Address: UNICAST_ADDRESS, ReqManager: &requestManager}
server.Run()