Code: Select all
import usocket as socket
import utime
from socket import AF_INET, SOCK_STREAM
while True:
s = socket.socket(AF_INET, SOCK_STREAM)
try:
# Guaranteed to return an address which can be
# connected to for stream operation.
address = s.connect(socket.getaddrinfo('smtp.gmail.com', 465, 0, SOCK_STREAM)[0][-1])
print(address)
except OSError as error:
pass
s.close()
utime.sleep(1)
Could someone tell me how to properly catch what getaddrinfo() is choking-on and/or run the script and tell me what happens on your ESP32.