Handling of timeout with net.socket:send()
Posted: Mon Mar 27, 2017 3:22 pm
I am using net.socket:send() to retrieve web content.
Occasionally there is no response without receiving a disconnect.
This leaves my application waiting indefinitely.
I have created a timer which is re-triggered every successful reception.
Bu what should I do in the timeout case?
If I reconnect the application stops: PANIC: unprotected error in call to Lua API (already connected)
How do I know if the connection is still open?
More in general: how can I deal with such errors (PANIC), preventing an application failure like shown above?
Occasionally there is no response without receiving a disconnect.
This leaves my application waiting indefinitely.
I have created a timer which is re-triggered every successful reception.
Bu what should I do in the timeout case?
If I reconnect the application stops: PANIC: unprotected error in call to Lua API (already connected)
How do I know if the connection is still open?
More in general: how can I deal with such errors (PANIC), preventing an application failure like shown above?