Esp8266通过Tcp连接前端服务器,测试通过
This commit is contained in:
parent
d361463057
commit
0507a7ca21
|
@ -181,7 +181,7 @@ void AP0801::InitClient()
|
|||
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));
|
||||
|
|
|
@ -77,7 +77,7 @@ bool EspSocket::OnOpen()
|
|||
/*if(Remote.Address == IPAddress::Broadcast())
|
||||
cmd += ",2";
|
||||
else*/
|
||||
cmd += ",0";
|
||||
if (Protocol == NetType::Udp) cmd += ",0";
|
||||
|
||||
// 打开Socket。有OK/ERROR/ALREADY CONNECTED三种
|
||||
auto rt = _Host.At.Send(cmd + "\r\n", "OK", "ERROR", 10000, false);
|
||||
|
|
Loading…
Reference in New Issue