Esp8266通过Tcp连接前端服务器,测试通过

This commit is contained in:
大石头 2017-03-23 18:41:06 +08:00
parent d361463057
commit 0507a7ca21
2 changed files with 2 additions and 2 deletions

View File

@ -181,7 +181,7 @@ void AP0801::InitClient()
if (Client) return; if (Client) return;
// 初始化令牌网 // 初始化令牌网
auto tk = TokenConfig::Create("smart.wslink.cn", NetType::Udp, 33333, 3377); auto tk = TokenConfig::Create("smart.wslink.cn", NetType::Tcp, 33333, 3377);
// 创建客户端 // 创建客户端
auto tc = TokenClient::CreateFast(Buffer(Data, Size)); auto tc = TokenClient::CreateFast(Buffer(Data, Size));

View File

@ -77,7 +77,7 @@ bool EspSocket::OnOpen()
/*if(Remote.Address == IPAddress::Broadcast()) /*if(Remote.Address == IPAddress::Broadcast())
cmd += ",2"; cmd += ",2";
else*/ else*/
cmd += ",0"; if (Protocol == NetType::Udp) cmd += ",0";
// 打开Socket。有OK/ERROR/ALREADY CONNECTED三种 // 打开Socket。有OK/ERROR/ALREADY CONNECTED三种
auto rt = _Host.At.Send(cmd + "\r\n", "OK", "ERROR", 10000, false); auto rt = _Host.At.Send(cmd + "\r\n", "OK", "ERROR", 10000, false);