StoreBackEnd/cmd/main.go

28 lines
698 B
Go
Raw Normal View History

package main
import (
"_StorBackEnd/pkg/network"
2022-02-22 08:29:11 +01:00
"_StorBackEnd/pkg/protocol"
"_StorBackEnd/pkg/protocol/repository"
)
const (
MULTICAST_ADDRESS = "226.66.66.1:42500"
MULTICAST_SECOND = 10 // TODO : Changer en 30 secondes
UNICAST_ADDRESS = "0.0.0.0:58000"
)
func main() {
println("StorBackEnd started !")
2022-02-22 08:29:11 +01:00
protocolRepository := repository.CreateProtocolRepository()
2022-02-22 08:29:11 +01:00
multicast := network.CreateClientMulticast(MULTICAST_ADDRESS, MULTICAST_SECOND, protocolRepository)
go multicast.Run()
2022-02-22 08:29:11 +01:00
requestManager := protocol.RequestManager{Repository: protocolRepository}
server := network.ServerUnicast{Network: "tcp", Address: UNICAST_ADDRESS, ReqManager: &requestManager}
server.Run()
}