登录是异步操作,需要等待一段时间,才能发送内网广播,否则WiFi模块AT指令冲突

This commit is contained in:
大石头 2017-03-29 18:21:25 +08:00
parent 028ceba5b6
commit c1fdf9446e
2 changed files with 5 additions and 1 deletions

View File

@ -44,7 +44,7 @@ bool EspSocket::OnOpen()
}
Local.Address = _Host.IP;
_Host.SetMux(true);
//_Host.SetMux(true);
#if NET_DEBUG
net_printf("%s::Open ", Protocol == NetType::Tcp ? "Tcp" : "Udp");

View File

@ -180,6 +180,8 @@ void TokenClient::CheckNet()
auto& nis = NetworkInterface::All;
for (int k = 0; k < nis.Count(); k++)
{
if (!nis[k]->Active()) continue;
// 检测该接口上是否创建了控制器
bool flag = false;
for (int i = 0; i < cs.Count(); i++)
@ -411,6 +413,8 @@ void TokenClient::LoopTask()
else
{
Login();
Sys.Sleep(1000);
// 登录成功以后做一次内网广播
SayHello(true);
}