I have a Python script that recursively sends data to a central server. The router will go to sleep until there's new data queued up to be transmitted. The wake up process takes about 20 Seconds or so thus I attempted to establish my connection as follows:
TIMEOUT = 100
def connect():
return HTTPConnection(HOST, timeout=TIMEOUT)
connection = connect()
Now, I'd expect the function HTTPConnection() to return only once the timeout has expired which isn't what it's doing. My function returns after 3 or so seconds and gives me a connection error. Why is that? Do I need to write my own timeout loop?
Thank you, Ron