Berry tcpclient uses Tasmota resolver (#17386)

This commit is contained in:
s-hadinger 2022-12-13 21:41:20 +01:00 committed by GitHub
parent b1fca09ad2
commit 0a57545e11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -194,7 +194,11 @@ extern "C" {
timeout = be_toint(vm, 4);
}
// open connection
bool success = tcp->connect(address, port, timeout);
IPAddress ipaddr;
bool success = WifiHostByName(address, ipaddr);
if (success) {
success = tcp->connect(ipaddr, port, timeout);
}
be_pushbool(vm, success);
be_return(vm); /* return self */
}