With each request, my Agent creates a timer that will timeout if no response arrives from the Device. That way, all requests can be confident of a response, even if it is to say that the Device didn’t respond.
Looks like I’ve been a bit too lax with keeping track of the number of timers I’m using. If my imp gets a lot of requests in close succession, I run out of timers. However, my Agent doesn’t really detect it, as it seems it’s only reported to the server log. It was by chance that I spotted the error recently.
The easy way for me to deal with it is to have a API call that gives me the number of timers remaining. Any chance of extending the API to support it. I could keep a counter, decrementing each time I create a timer and incrementing when the timer expires (or is cancelled). But that’s a bit of a pain when I use timers all over the place.
Can I be confident that this number (which seems arbitrary) will stay the same? If so, I’ll set a limit and queue any other requests until the dispatched requests are completed.