rotate multicast based on current time

This commit is contained in:
Zack Scholl 2018-12-14 06:32:44 -08:00
parent e58fc14218
commit 43dbf98705
1 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ func (c *Croc) Send(fname, codephrase string) (err error) {
TimeLimit: 600 * time.Second,
Delay: 50 * time.Millisecond,
Payload: []byte(c.RelayWebsocketPort + "- " + strings.Join(c.RelayTCPPorts, ",")),
MulticastAddress: "239.255.255.252",
MulticastAddress: fmt.Sprintf("239.255.255.%d", 230+int64(time.Now().Minute()/5)),
})
log.Debug(discovered, err)
}()
@ -91,7 +91,7 @@ func (c *Croc) Receive(codephrase string) (err error) {
Payload: []byte("checking"),
AllowSelf: true,
DisableBroadcast: true,
MulticastAddress: "239.255.255.252",
MulticastAddress: fmt.Sprintf("239.255.255.%d", 230+int64(time.Now().Minute()/5)),
})
log.Debug("finished")
log.Debug(discovered)