Commit 7d5fa08e authored by szh's avatar szh

add wlan0 and eth0 net ip

parent d7b8d132
......@@ -96,8 +96,12 @@ func broadcast() {
//ip 会变化
ip,err := util.GetLocalIpByName("wlan0")
if err != nil {
if err != nil || ip == nil {
tlog.Error("broadcast",err)
ip,err = util.GetLocalIpByName("eth0")
if err != nil {
panic(err)
}
}
// 这里设置发送者的IP地址,自己查看一下自己的IP自行设定
laddr := net.UDPAddr{
......
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