Adding check against garbage in multicast
parent
ba3ba3099b
commit
e0bac1798a
|
@ -81,7 +81,16 @@ func (b *AbstractBridge) HierarchyReLocator(entity AbstractMulticast) {
|
|||
re := regexp.MustCompile("[0-9]+")
|
||||
|
||||
for bstNumber := range BstChannel {
|
||||
bstNumber = re.FindAllString(bstNumber, -1)[0]
|
||||
|
||||
cleanStr := re.FindAllString(bstNumber, -1)
|
||||
if cleanStr == nil {
|
||||
log.Println("No numbers in multicast: ", bstNumber)
|
||||
continue
|
||||
} else {
|
||||
log.Println("Extracted numbers in multicast: ", cleanStr)
|
||||
bstNumber = cleanStr[0]
|
||||
}
|
||||
|
||||
brdNumber, err := strconv.ParseInt(bstNumber, 10, 64)
|
||||
if err != nil {
|
||||
log.Println("Garbage received on multicast: ", bstNumber)
|
||||
|
|
Loading…
Reference in New Issue