fix: 修复获取主机ip错误的问题
This commit is contained in:
@@ -54,6 +54,13 @@ public class NetConfig
|
||||
// 清除UDP服务器接收缓冲区
|
||||
MsgBus.UDPServer.ClearUDPData(this.address, this.taskID);
|
||||
|
||||
// 刷新ARP
|
||||
var refrshRet = await Arp.UpdateArpEntryByPingAsync(this.address);
|
||||
if (!refrshRet)
|
||||
{
|
||||
logger.Warn($"Refrash Arp failed, but maybe not a big deal.");
|
||||
}
|
||||
|
||||
var ipBytes = ip.GetAddressBytes();
|
||||
|
||||
var ret = await UDPClientPool.WriteAddrSeq(this.ep, this.taskID, NetConfigAddr.HOST_IP, ipBytes, this.timeout);
|
||||
@@ -98,6 +105,13 @@ public class NetConfig
|
||||
// 清除UDP服务器接收缓冲区
|
||||
MsgBus.UDPServer.ClearUDPData(this.address, this.taskID);
|
||||
|
||||
// 刷新ARP
|
||||
var refrshRet = await Arp.UpdateArpEntryByPingAsync(this.address);
|
||||
if (!refrshRet)
|
||||
{
|
||||
logger.Warn($"Refrash Arp failed, but maybe not a big deal.");
|
||||
}
|
||||
|
||||
var ipBytes = ip.GetAddressBytes();
|
||||
|
||||
var ret = await UDPClientPool.WriteAddrSeq(this.ep, this.taskID, NetConfigAddr.BOARD_IP, ipBytes, this.timeout);
|
||||
@@ -146,6 +160,13 @@ public class NetConfig
|
||||
|
||||
// 清除UDP服务器接收缓冲区
|
||||
MsgBus.UDPServer.ClearUDPData(this.address, this.taskID);
|
||||
|
||||
// 刷新ARP
|
||||
var refrshRet = await Arp.UpdateArpEntryByPingAsync(this.address);
|
||||
if (!refrshRet)
|
||||
{
|
||||
logger.Warn($"Refrash Arp failed, but maybe not a big deal.");
|
||||
}
|
||||
|
||||
var ret = await UDPClientPool.WriteAddrSeq(this.ep, this.taskID, NetConfigAddr.HOST_MAC, macAddress, this.timeout);
|
||||
if (!ret.IsSuccessful)
|
||||
@@ -193,6 +214,13 @@ public class NetConfig
|
||||
|
||||
// 清除UDP服务器接收缓冲区
|
||||
MsgBus.UDPServer.ClearUDPData(this.address, this.taskID);
|
||||
|
||||
// 刷新ARP
|
||||
var refrshRet = await Arp.UpdateArpEntryByPingAsync(this.address);
|
||||
if (!refrshRet)
|
||||
{
|
||||
logger.Warn($"Refrash Arp failed, but maybe not a big deal.");
|
||||
}
|
||||
|
||||
var ret = await UDPClientPool.WriteAddrSeq(this.ep, this.taskID, NetConfigAddr.BOARD_MAC, macAddress, this.timeout);
|
||||
if (!ret.IsSuccessful)
|
||||
@@ -234,6 +262,13 @@ public class NetConfig
|
||||
{
|
||||
// 清除UDP服务器接收缓冲区
|
||||
MsgBus.UDPServer.ClearUDPData(this.address, this.taskID);
|
||||
|
||||
// 刷新ARP
|
||||
var refrshRet = await Arp.UpdateArpEntryByPingAsync(this.address);
|
||||
if (!refrshRet)
|
||||
{
|
||||
logger.Warn($"Refrash Arp failed, but maybe not a big deal.");
|
||||
}
|
||||
|
||||
var ret = await UDPClientPool.ReadAddrSeq(this.ep, this.taskID, NetConfigAddr.HOST_IP, this.timeout);
|
||||
if (!ret.IsSuccessful)
|
||||
@@ -261,6 +296,13 @@ public class NetConfig
|
||||
{
|
||||
// 清除UDP服务器接收缓冲区
|
||||
MsgBus.UDPServer.ClearUDPData(this.address, this.taskID);
|
||||
|
||||
// 刷新ARP
|
||||
var refrshRet = await Arp.UpdateArpEntryByPingAsync(this.address);
|
||||
if (!refrshRet)
|
||||
{
|
||||
logger.Warn($"Refrash Arp failed, but maybe not a big deal.");
|
||||
}
|
||||
|
||||
var ret = await UDPClientPool.ReadAddrSeq(this.ep, this.taskID, NetConfigAddr.BOARD_IP, this.timeout);
|
||||
if (!ret.IsSuccessful)
|
||||
@@ -289,6 +331,13 @@ public class NetConfig
|
||||
// 清除UDP服务器接收缓冲区
|
||||
MsgBus.UDPServer.ClearUDPData(this.address, this.taskID);
|
||||
|
||||
// 刷新ARP
|
||||
var refrshRet = await Arp.UpdateArpEntryByPingAsync(this.address);
|
||||
if (!refrshRet)
|
||||
{
|
||||
logger.Warn($"Refrash Arp failed, but maybe not a big deal.");
|
||||
}
|
||||
|
||||
var ret = await UDPClientPool.ReadAddrSeq(this.ep, this.taskID, NetConfigAddr.HOST_MAC, this.timeout);
|
||||
if (!ret.IsSuccessful)
|
||||
{
|
||||
@@ -315,6 +364,13 @@ public class NetConfig
|
||||
{
|
||||
// 清除UDP服务器接收缓冲区
|
||||
MsgBus.UDPServer.ClearUDPData(this.address, this.taskID);
|
||||
|
||||
// 刷新ARP
|
||||
var refrshRet = await Arp.UpdateArpEntryByPingAsync(this.address);
|
||||
if (!refrshRet)
|
||||
{
|
||||
logger.Warn($"Refrash Arp failed, but maybe not a big deal.");
|
||||
}
|
||||
|
||||
var ret = await UDPClientPool.ReadAddrSeq(this.ep, this.taskID, NetConfigAddr.BOARD_MAC, this.timeout);
|
||||
if (!ret.IsSuccessful)
|
||||
|
||||
Reference in New Issue
Block a user