|
@@ -38,6 +38,16 @@ func main() {
|
|
|
udpclient = mu.UdpClient{Local: Sysconfig["udpip"].(string) + ":" + Sysconfig["udpport"].(string), BufSize: 1024}
|
|
|
udpclient.Listen(processUdpMsg)
|
|
|
log.Printf("Udp listening port: %s:%s\n", Sysconfig["udpip"], Sysconfig["udpport"])
|
|
|
+ if Sysconfig["broadcast"].(bool){//重启的话通知分布式节点
|
|
|
+ ips := qu.ObjToString(Sysconfig["broadcast_ips"])
|
|
|
+ ipsArr := strings.Split(ips, ";")
|
|
|
+ for _,v := range ipsArr{
|
|
|
+ udpclient.WriteUdp([]byte{},mu.OP_NOOP,&net.UDPAddr{
|
|
|
+ IP: net.ParseIP(v),
|
|
|
+ Port: qu.IntAll(Sysconfig["broadcast_port"]),
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
b := make(chan bool, 1)
|
|
|
<-b
|
|
|
}
|