Commit 512e69e3 authored by szh's avatar szh

update

parent 56aeb4f3
...@@ -53,7 +53,7 @@ func Broadcast() { ...@@ -53,7 +53,7 @@ func Broadcast() {
//ip 会变化 //ip 会变化
ip,err = util.GetLocalIpByName("wlan0") ip,err = util.GetLocalIpByName("wlan0")
if err != nil || ip == nil { if err != nil || ip == nil {
tlog.Error("broadcast",err) tlog.Error("broadcast","err","wlan0 not exists")
ip,err = util.GetLocalIpByName("eth0") ip,err = util.GetLocalIpByName("eth0")
if err != nil { if err != nil {
panic(err) panic(err)
...@@ -82,7 +82,9 @@ func Broadcast() { ...@@ -82,7 +82,9 @@ func Broadcast() {
_, err = conn.Write([]byte(send)) _, err = conn.Write([]byte(send))
if err != nil{ if err != nil{
panic(err) tlog.Error("broadcast ","err",err)
time.Sleep(time.Second*1)
continue
} }
tlog.Info("broadcast","ip:",ip.IP.String(),"udp",send) tlog.Info("broadcast","ip:",ip.IP.String(),"udp",send)
time.Sleep(time.Second*1) time.Sleep(time.Second*1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment