the socket rabbit hole
Posted: Mon Apr 25, 2022 3:20 am
I've tended to use urequests or variants of it for for server connections but I've never been really happy with it. There are some overly long non user adjustable timeouts baked into it & the DNS lookups can be cranky on lte based bearers.
Many examples of connecting to servers tend not to use urequests & show examples based simply on sockets. I tend to disregard them because they don't use ssl. Recently a Freenove example
used the socket.SO_REUSEADDR cmd. This was new to me https://stackoverflow.com/questions/322 ... tion-linux & got me wondering how these non urequests based connections convert the server name to an ip address since there is no obvious DNS lookup? Can anyone enlighten me?
Many examples of connecting to servers tend not to use urequests & show examples based simply on sockets. I tend to disregard them because they don't use ssl. Recently a Freenove example
Code: Select all
connectWifi(ssidRouter,passwordRouter)
s = socket.socket()
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.connect((host,port))